Part Number Hot Search : 
1060C DZ11B AVF30007 MBT2222 5945B WU204 SM6T56CA 78L20
Product Description
Full Text Search
 

To Download ADUC836 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  information furnished by analog devices is be lieved to be accurate and reliable. however, no responsibility is assumed by analog devices for its use, nor for any infringements of patents or other rights of third parties that may result from its use. no license is granted by implication or other- wise under any patent or patent rights of analog devices. t rademarks and registered trademarks are the property of their respective companies. one technology way, p.o. box 9106, norwood, ma 02062-9106, u.s.a. t el: 781/329-4700 www.analog.com fa x: 781/326-8703 ? 2002 analog devices, inc. all rights reserved. ADUC836 microconverter ? , dual 16-bit - adcs with embedded 62 kb flash mcu features high resolution - adcs 2 independent adcs (16-bit resolution) 16-bit no missing codes, primary adc 16-bit rms (16-bit p-p) effective resolution @ 20 hz offset drift 10 nv/ c, gain drift 0.5 ppm/ c memory 62 kbytes on-chip flash/ee program memory 4 kbytes on-chip flash/ee data memory flash/ee, 100 year retention, 100 kcycles endurance 3 levels of flash/ee program memory security in-circuit serial download (no external hardware) high speed user download (5 seconds) 2304 bytes on-chip data ram 8051 based core 8051 compatible instruction set 32 khz external crystal on-chip programmable pll (12.58 mhz max) 3 16-bit timer/counter 26 programmable i/o lines 11 interrupt sources, 2 priority levels dual data pointer, extended 11-bit stack pointer on-chip peripherals internal power on reset circuit 12-bit voltage output dac dual 16-bit - dacs/pwms on-chip temperature sensor dual excitation current sources time interval counter (wake-up/rtc timer) uart, spi ? , a nd i 2 c ? serial i/o high speed baud rate generator (including 115,200) wa tchdog timer (wdt) po we r supply monitor (psm) power normal: 2.3 ma max @ 3.6 v (core clk = 1.57 mhz) power-down: 20 a max with wake-up timer running speci? ed for 3 v and 5 v operation pa ck age and temperature range 52-lead mqfp (14 mm 14 mm), ?40 c to +125 c 56-lead csp (8 mm 8 mm), ?40 c to +85 c applications intelligent sensors wei gh scales po rt able instrumentation, battery-powered systems 4?20 ma transmitters da ta logging precision system monitoring functional block diagram 62 kbytes flash/ee program memory 4 kbytes flash/ee data memory 2304 bytes user ram 3 16 bit timers baud r ate timer 4 parallel ports 8051-based mcu with additional peripherals power supply mon watchdog timer uart, spi, and i 2 c serial i/o ADUC836 xtal2 xtal1 buf agnd refin+ refin internal band gap v ref ain1 ain2 ain3 ain4 ain5 auxiliary 16-bit - adc primary 16-bit - adc mux osc av dd mux pga dual 16-bit - dac buf dac current source av dd iexc1 iexc2 pwm0 pwm1 dual 16-bit pwm w ake- up/ rtc timer temp sensor external v ref detect 12-bit dac mux dgnd dv dd reset por pll and prog clock div general description the ADUC836 is a complete smart transducer front end, integrating two high resolution - adcs, an 8-bit mcu, and p rogram/data flash/ee memory on a single chip. the two independent adcs (primary and auxiliary) include a temperature sensor and a pga (allowing direct measurement of low level signals). the adcs with on-chip digital ltering and programmable output data rates are intended for the measure- ment of wide dynamic range, low frequency signals, such as those in weigh scale, strain gage, pressure transducer, or temperature measurement applications. the device operates from a 32 khz crystal with an on-chip pll generating a high frequency clock of 12.58 mhz. this clock is routed through a programmable clock divider from which the mcu core clock operating frequency is generated. the microcontroller core is an 8052 and therefore 8051 instruction set compatible with 12 core clock periods per machine cycle. 62 kbytes of nonvolatile flash/ee program memory, 4 kbytes of nonvolatile flash/ee data memory, and 2304 bytes of data ram are provided on-chip. the program memory can be con gured as data memory to give up to 60 kbytes of nv data memory in data logging applications. on-chip factory rm w are supports in-circuit serial download and debug modes (via uart), as well as single-pin emulation mode via the ea pin. the ADUC836 is supported by a quickstart development system featuring low cost software and hardware development tools. rev. 0
ADUC836 ?2? t able of contents features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 functional block diagram . . . . . . . . . . . . . . . . . .1 general description . . . . . . . . . . . . . . . . . . . . . . . . .1 specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 absolute maximum ratings . . . . . . . . . . . . . . . . .9 ordering guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9 pin configurations . . . . . . . . . . . . . . . . . . . . . . . . . . .9 detailed block diagram . . . . . . . . . . . . . . . . . . . .10 pin function descriptions . . . . . . . . . . . . . . . . . .10 memory organization . . . . . . . . . . . . . . . . . . . . . . .13 special function registers (sfrs) . . . . . . . . . .14 accumulator sfr (acc) . . . . . . . . . . . . . . . . . . . . . . . . . .14 b sfr (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14 data pointer (dptr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14 stack pointer (sp and sph) . . . . . . . . . . . . . . . . . . . . . . . .15 program status word (psw) . . . . . . . . . . . . . . . . . . . . . . . .15 po w er control sfr (pcon) . . . . . . . . . . . . . . . . . . . . . . .15 ADUC836 con guration sfr (cfg836) . . . . . . . . . . . . . .15 complete sfr map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 adc sfr interface adcstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 adcmode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 adc0con . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 adc1con . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 adc0h/adc0m/adc1h/adc1l . . . . . . . . . . . . . . . . . .20 of0h/of0m/of1h/of1l . . . . . . . . . . . . . . . . . . . . . . . .20 gn0h/gn0m/gn1h/gn1l . . . . . . . . . . . . . . . . . . . . . . .20 sf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 icon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 primary and auxiliary adc noise performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 primary and auxiliary adc circuit description overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 primary adc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 auxiliary adc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 analog input channels . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 primary and auxiliary adc inputs . . . . . . . . . . . . . . . . . . .25 analog input ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 programmable gain ampli er . . . . . . . . . . . . . . . . . . . . . . .25 bipolar/unipolar inputs . . . . . . . . . . . . . . . . . . . . . . . . . . .25 reference input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 burnout currents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 excitation currents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 reference detect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26  -  modulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 digital filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 adc chopping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 nonvolatile flash/ee memory flash/ee memory overview . . . . . . . . . . . . . . . . . . . . . . . .29 flash/ee memory and the ADUC836 . . . . . . . . . . . . . . . . .29 ADUC836 flash/ee memory reliability . . . . . . . . . . . . . . .29 flash/ee program memory . . . . . . . . . . . . . . . . . . . . . . . .30 serial downloading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 parallel programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 user download mode (uload) . . . . . . . . . . . . . . . . . . . .31 flash/ee program memory security . . . . . . . . . . . . . . . . . .31 lock, secure, and serial safe modes . . . . . . . . . . . . . . . . . .31 using the flash/ee data memory . . . . . . . . . . . . . . . . . . .32 econ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 programming the flash/ee data memory . . . . . . . . . . . . .33 flash/ee memory timing . . . . . . . . . . . . . . . . . . . . . . . . . .33 o ther on-chip peripherals dac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 pwm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 on-chip pll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 time interval counter (wake-up/rtc timer) . . . . . . . . .40 watchdog timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 po w er supply monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 serial peripheral interface (spi) . . . . . . . . . . . . . . . . . . . . .44 i 2 c serial interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46 dual data pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 8052 compatible on-chip peripherals parallel i/o ports 0? . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49 timers/counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 uart serial interface . . . . . . . . . . . . . . . . . . . . . . . . . . . .57 ua rt operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . .57 baud rate generation using timer 1 and timer 2 . . . . . . .59 baud rate generation using timer 3 . . . . . . . . . . . . . . . . .60 interrupt system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 hardware design considerations external memory interface . . . . . . . . . . . . . . . . . . . . . . . . .63 po w er supplies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 power-on reset (por) operation . . . . . . . . . . . . . . . . . . .64 po w er consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 power saving modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65 wake-up from power-down latency . . . . . . . . . . . . . . . . .65 grounding and board layout recommendations . . . . . . . .66 ADUC836 system self-identi cation . . . . . . . . . . . . . . . . . .66 clock oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 o ther hardware considerations in-circuit serial download access . . . . . . . . . . . . . . . . . . .67 embedded serial port debugger . . . . . . . . . . . . . . . . . . . . .67 single-pin emulation mode . . . . . . . . . . . . . . . . . . . . . . . .67 typical system con guration . . . . . . . . . . . . . . . . . . . . . . .68 q uickstart development system . . . . . . . . . . .69 timing specifications . . . . . . . . . . . . . . . . . . . . . . .70 outline dimensions . . . . . . . . . . . . . . . . . . . . . . . . .80 rev. 0
ADUC836 ?3? (av dd = 2.7 v to 3.6 v or 4.75 v to 5.25 v, dv dd = 2.7 v to 3.6 v or 4.75 v to 5.25 v, refin(+) = 2.5 v; refin(?) = agnd; agnd = dgnd = 0 v; xtal1/xtal2 = 32.768 khz crystal; all spec i ? ca tions t min to t max , unless oth er wise not ed.) p arameter ADUC836 test conditions/comments unit adc specifications conversion rate 5.4 on both channels hz mi n 105 programmable in 0.732 ms increments hz max primary adc no missing codes 2 16 20 hz update rate bits min resolution 13.5 range = ?0 mv, 20 hz update rate bits p-p typ 16 range = ?.56 v, 20 hz update rate bits p-p t yp output noise see tables x and xi in output noise varies with selected ADUC836 adc description update rate and gain range integral nonlinearity ?5 1 lsb ppm of fsr max offset error 3 ? v typ offset error drift ?0 nv/? typ full-scale error 4 ?0 range = ?0 mv to ?40 mv v typ ?.5 range = ?.28 v to ?.56 v l sb typ gain error drift 5 ?.5 ppm/? typ adc range matching ? ain = 18 mv v typ power supply rejection (psr) 95 ain = 7.8 mv, range = ?0 mv dbs typ 80 ain = 1 v, range = ?.56 v dbs typ common-mode dc rejection on ain 95 at dc, ain = 7.8 mv, range = ?0 mv dbs typ 113 at dc, ain = 1 v, range = ?.56 v dbs typ on refin 125 at dc, ain = 1 v, range = ?.56 v dbs typ common-mode 50 hz/60 hz rejection 20 hz up date rate on ain 95 50 hz/60 hz ? hz, ain = 7.8 mv, dbs typ range = ?0 mv 90 50 hz/60 hz ? hz, ain = 1 v, dbs ty p range = ?.56 v on refin 90 50 hz/60 hz ? hz, ain = 1 v, dbs typ range = ?.56 v normal mode 50 hz/60 hz rejection on ain 60 50 hz/60 hz ? hz, 20 hz update rate dbs typ on refin 60 50 hz/60 hz ? hz, 20 hz update rate dbs typ auxiliary adc no missing codes 2 16 bits min resolution 16 range = ?.5 v, 20 hz update rate bits p-p typ output noise see table xii in ADUC836 output noise varies with selected adc description update rate integral nonlinearity ?5 ppm of fsr max offset error 3 ? lsb typ offset error drift 1 v/? typ full-scale error 6 ?.5 lsb typ gain error drift 5 ?.5 ppm/? typ power supply rejection (psr) 80 ain = 1 v, 20 hz update rate dbs typ normal mode 50 hz/60 hz rejection on ain 60 50 hz/60 hz ? hz dbs t yp on refin 60 50 hz/60 hz ? hz, 20 hz update rate dbs typ da c performance dc speci cations 7 resolution 12 bits relative accuracy ? lsb typ differential nonlinearity ? guaranteed 12-bit monotonic lsb max offset error ?0 mv max gain error 8 ? av dd range % max ? v ref range % typ ac speci cations 2, 7 voltage output settling time 15 settling time to 1 lsb of final value s typ digital-to-analog glitch energy 10 1 lsb change at major carry nvs typ specifications 1 rev. 0
?4? ADUC836 p arameter ADUC836 test conditions/comments unit internal reference adc reference reference voltage 1.25 ?1% initial tolerance @ 25?, v dd = 5 v v min/max power supply rejection 45 dbs typ reference tempco 100 ppm/? typ dac reference reference voltage 2.5 ?1% initial tolerance @ 25?, v dd = 5 v v min/max power supply rejection 50 dbs typ reference tempco ?00 ppm/? typ analog inputs/reference inputs primary adc differential input voltage ranges 9, 10 external reference voltage = 2.5 v rn2, rn1, rn0 of adc0con set to bipolar mode (adc0con3 = 0) ?0 0 0 0 (unipolar mode 0 mv to 20 mv) mv ?0 0 0 1 (unipolar mode 0 mv to 40 mv) mv ?0 0 1 0 (unipolar mode 0 mv to 80 mv) mv ?60 0 1 1 (unipolar mode 0 mv to 160 mv) mv ?20 1 0 0 (unipolar mode 0 mv to 320 mv) mv ?40 1 0 1 (unipolar mode 0 mv to 640 mv) mv ?.28 1 1 0 (unipolar mode 0 v to 1.28 v) v ?.56 1 1 1 (unipolar mode 0 v to 2.56 v) v analog input current 2 ? t max = 85? na max ? t max = 125? na max analog input current drift ? t max = 85? pa/? typ ?5 t max = 125? pa/? typ absolute ain voltage limits 2 agnd + 100 mv v min av dd ?100 mv v max auxiliary adc input voltage range 9, 10 0 to v ref unipolar mode, for bipolar mode v see note 11 average analog input current 125 input current will vary with input na/v typ average analog input current drift 2 ? voltage on the unbuffered auxiliary adc pa/v/? typ absolute ain voltage limits 2, 11 agnd ?30 mv v min av dd + 30 mv v max external reference inputs refin(+) to refin(? range 2 1 v min av dd v max average reference input current 1 both adcs enabled a/v typ average reference input current drift ?.1 na/ v/? typ ?o ext. ref trigger voltage 0.3 noxref bit active if v ref < 0.3 v v min 0.65 noxref bit inactive if v ref > 0.65 v v max adc system calibration full-scale calibration limit 1.05 fs v max zero-scale calibration limit ?.05 fs v min input span 0.8 fs v min 2.1 fs v max analog (dac) output voltage range 0 to v ref da crn = 0 in daccon sfr v typ 0 to av dd da crn = 1 in daccon sfr v typ resistive load 10 from dac output to agnd k typ capacitive load 100 from dac output to agnd pf typ output impedance 0.5 typ i sink 50 a typ temperature sensor accuracy ? ? typ thermal impedance ( ja ) 90 mqfp package ?/w typ 52 csp package (base floating) 12 ?/w typ specifications (continued) rev. 0
ADUC836 ?5? p arameter ADUC836 test conditions/comments unit transducer burnout current sources ain+ current ?00 ain+ is the selected positive input na typ to the primary adc ain?current +100 ain?is the selected negative input na typ to the auxiliary adc initial tolerance @ 25? ?0 % typ drift 0.03 %/? typ excitation current sources output current ?00 available from each current source a typ initial tolerance @ 25? ?0 % typ drift 200 ppm/? typ initial current matching @ 25? ? matching between both current sources % typ drift matching 20 ppm/? typ line regulation (av dd ) 1 av dd = 5 v + 5% a/v typ load regulation 0.1 a/v typ output compliance 2 av dd ?0.6 v max agnd v min logic inputs all inputs except sclock, reset, and xtal1 2 v inl , input low voltage 0.8 dv dd = 5 v v max 0.4 dv dd = 3 v v max v inh , input high voltage 2.0 v min sclock and reset only (schmitt-triggered inputs) 2 v t+ 1.3/3 dv dd = 5 v v min/v max 0.95/2.5 dv dd = 3 v v min/v max v t 0.8/1.4 dv dd = 5 v v min/v max 0.4/1.1 dv dd = 3 v v min/v max v t+ ? v t 0.3/0.85 dv dd = 5 v v min/v max 0.3/0.85 dv dd = 3 v v min/v max input currents port 0, p1.2?1.7, ea ?0 v in = 0 v or v dd a max sclock, mosi, miso, ss 13 ?0 min, ?0 max v in = 0 v, dv dd = 5 v, internal pull-up a min/ a max ?0 v in = v dd , dv dd = 5 v a max reset ?0 v in = 0 v, dv dd = 5 v a max 35 min, 105 max v in = v dd , dv dd = 5 v, a min/ a max internal pull-down p1.0, p1.1, ports 2 and 3 ?0 v in = v dd , dv dd = 5 v a max ?80 v in = 2 v, dv dd = 5 v a min ?60 a max ?0 v in = 450 mv, dv dd = 5 v a min ?5 a max input capacitance 5 all digital inputs pf t yp crystal oscillator (xtal1 and xtal2) logic inputs, xtal1 only 2 v inl , input low voltage 0.8 dv dd = 5 v v max 0.4 dv dd = 3 v v max v inh , input high voltage 3.5 dv dd = 5 v v min 2.5 dv dd = 3 v v min xtal1 input capacitance 18 pf typ xtal2 output capacitance 18 pf typ rev. 0
?6? ADUC836 specifications (continued) p arameter ADUC836 test conditions/comments unit logic outputs (not including xtal2) 2 v oh , output high voltage 2.4 v dd = 5 v, i source = 80 a v min 2.4 v dd = 3 v, i source = 20 a v min v ol , output low voltage 14 0.4 i sink = 8 ma, sclock, mosi/sdata v max 0.4 i sink = 10 ma, p1.0 and p1.1 v max 0.4 i sink = 1.6 ma, all other outputs v max floating state leakage current 2 ?0 a max floating state output capacitance 5 pf ty p power supply monitor (psm) av dd tr ip point selection range 2.63 four trip points selectable in this range v min 4.63 programmed via tpa1? in psmcon v max av dd power supply trip point accuracy ?.0 t max = 85? % max ?.0 t max = 125? % max dv dd tr ip point selection range 2.63 four trip points selectable in this range v min 4.63 programmed via tpd1? in psmcon v max dv dd power supply trip point accuracy ?.0 t max = 85 c % max ?.0 t max = 125 c % max wa tchdog timer (wdt) timeout period 0 nine timeout periods in this range ms min 2000 programmed via pre3? in wdcon ms max mcu core clock rate clock rate generated via on-chip pll mcu clock rate 2 98.3 programmable via cd2? bits in khz min pllcon sfr 12.58 mhz max start-up time at power-on 300 ms typ after external reset in normal mode 3 ms typ after wdt reset in normal mode 3 controlled via wdcon sfr ms typ from idle mode 10 s typ from power-down mode oscillator running osc_pd bit = 0 in pllcon sfr wake-up with int0 interrupt 20 s typ wake-up with spi interrupt 20 s typ wake-up with tic interrupt 20 s typ wake-up with external reset 3 ms typ oscillator powered down osc_pd bit = 1 in pllcon sfr wake-up with int0 interrupt 20 s typ wake-up with spi interrupt 20 s typ wake-up with external reset 5 ms typ flash/ee memory reliability characteristics 15 endurance 16 100,000 cycles min data retention 17 100 years min rev. 0
ADUC836 ?7? p arameter ADUC836 test conditions/comments unit power requirements dv dd and av dd can be set independently power supply voltages av dd , 3 v nominal operation 2.7 v min 3.6 v max av dd , 5 v nominal operation 4.75 v min 5.25 v max dv dd , 3 v nominal operation 2.7 v min 3.6 v max dv dd , 5 v nominal operation 4.75 v min 5.25 v max 5 v power consumption dv dd = 4.75 v to 5.25 v, av dd = 5.25 v power supply currents normal mode 18, 19 dv dd current 4 core clk = 1.57 mhz ma max dv dd current 13 core clk = 12.58 mhz ma typ 16 core clk = 12.58 mhz ma max av dd current 180 core clk = 1.57 mhz or 12.58 mhz a max power supply currents power-down mode 18, 19 core clk = 1.57 mhz or 12.58 mhz dv dd current 53 t max = 85?; osc. on, tic on a max 100 t max = 125?; osc. on, tic on a max dv dd current 30 t max = 85?; osc. off a max 80 t max = 125?; osc. off a max av dd current 1 t max = 85?; osc. on or osc. off a max 3 t max = 125?; osc. on or osc. off a max t ypical additional power supply currents core clk = 1.57 mhz (ai dd and di dd ) psm peripheral 50 a typ primary adc 1 ma typ auxiliary adc 500 a typ dac 150 a typ dual current sources 400 a typ 3 v power consumption dv dd = 2.7 v to 3.6 v power supply currents normal mode 18, 19 dv dd current 2.3 core clk = 1.57 mhz ma max dv dd current 8 core clk = 12.58 mhz ma typ 10 core clk = 12.58 mhz ma max av dd current 180 av dd = 5.25 v, core clk = 1.57 mhz or 12.58 mhz a max power supply currents power-down mode 18, 19 core clk = 1.57 mhz or 12.58 mhz dv dd current 20 t max = 85?; osc. on, tic on a max 40 t max = 125?; osc. on, tic on a max dv dd current 10 osc. off a typ av dd current 1 av dd = 5.25 v; t max = 85?; osc. on or osc. off a max 3 av dd = 5.25 v; t max = 125?; osc. on or osc. off a max rev. 0
ADUC836 ?8? notes 1 te mperature range for ADUC836bs (mqfp package) is ?0? to +125?. temperature range for ADUC836bcp (csp package) is ?0? to + 85?. 2 these numbers are not production tested but are guaranteed by design and/or characterization data on production release. 3 system zero-scale calibration can remove this error. 4 the primary adc is factory calibrated at 25? with av dd = dv dd = 5 v yielding this full-scale error of 10 v. if user power supply or temperature conditions are signi cantly different from these, an internal full-scale calibration will restore this error to 10 v. a system zero-scale and full-scale calibration will remove this error altogether. 5 gain error drift is a span drift. to calculate full-scale error drift, add the offset error drift to the gain error drift times the full-scale input. 6 the auxiliary adc is factory calibrated at 25? with av dd = dv dd = 5 v yielding this full-scale error of ?.5 lsb. a system zero-scale and full-scale calibration will remove this error altogether. 7 da c linearity and ac speci cations are calculated using: reduced code range of 48 to 4095, 0 to v ref ; reduced code range of 100 to 3950, 0 to v dd . 8 gain error is a measurement of the span error of the dac. 9 in general terms, the bipolar input voltage range to the primary adc is given by range adc = ?v ref 2 rn )/125, where: v ref = refin(+) to refin(? voltage and v ref = 1.25 v when internal adc v ref is selected. rn = decimal equivalent of rn2, rn1, rn0, e.g., v ref = 2.5 v and rn2, rn1, rn0 = 1, 1, 0 the range adc = ?.28 v. in unipolar mode, the effective range is 0 v to 1.28 v in our example. 10 1.25 v is used as the reference voltage to the auxiliary adc when internal v ref is selected via xref0 and xref1 bits in adc0con and adc1con, respectively. 11 in bipolar mode, the auxiliary adc can only be driven to a minimum of agnd ?30 mv as indicated by the auxiliary adc absolute a in voltage limits. the bipolar range is still ? ref to +v ref ; however, the negative voltage is limited to ?0 mv. 12 the ADUC836bcp (csp package) has been quali ed and tested with the base of the csp package oating. 13 pins con gured in spi mode, pins con gured as digital inputs during this test. 14 pins con gured in i 2 c mode only. 15 flash/ee memory reliability characteristics apply to both the flash/ee program memory and flash/ee data memory. 16 endurance is quali ed to 100 kcycles as per jedec std. 22 method a117 and measured at ?0?, +25?, +85?, and +125?. typical endurance at 25? is 700 kcycles. 17 retention lifetime equivalent at junction temperature (t j ) = 55? as per jedec std. 22, method a117. retention lifetime based on an activation energy of 0.6 ev will derate with junction temperature as shown in figure 16 in the flash/ee memory section. 18 po w er supply current consumption is measured in normal, idle, and power-down modes under the following conditions: normal mode: reset = 0.4 v, digital i/o pins = open circuit, core clk changed via cd bits in pllcon, core executing internal software loop. idle mode: reset = 0.4 v, digital i/o pins = open circuit, core clk changed via cd bits in pllcon, pcon.0 = 1, core executio n suspended in idle mode. power-down mode: reset = 0.4 v, all p0 pins and p1.2?1.7 pins = 0.4 v, all other digital i/o pins are open circuit, core cl k changed via cd bits in pllcon, pcon.1 = 1, core execution suspended in power-down mode, osc turned on or off via osc_pd bit (pllcon.7) in pllcon sfr. 19 dv dd power supply current will increase typically by 3 ma (3 v operation) and 10 ma (5 v operation) during a flash/ee memory progra m or erase cycle. speci cations subject to change without notice. rev. 0
ADUC836 ?9? ordering guide model temperature range package description package option ADUC836bs ?0? to +125? 52-lead plastic quad flatpack s-52 ADUC836bcp ?0? to +85? 56-lead chip scale package cp-56 eval-ADUC836qs quickstart development system absolute maximum ratings 1 (t a = 25?, unless otherwise noted.) av dd to agnd . . . . . . . . . . . . . . . . . . . . . . . . . ?.3 v to +7 v av dd to dgnd . . . . . . . . . . . . . . . . . . . . . . . . . ?.3 v to +7 v dv dd to agnd . . . . . . . . . . . . . . . . . . . . . . . . . ?.3 v to +7 v dv dd to dgnd . . . . . . . . . . . . . . . . . . . . . . . . ?.3 v to +7 v a gnd to dgnd 2 . . . . . . . . . . . . . . . . . . . . . . ?.3 v to +0.3 v av dd to dv dd . . . . . . . . . . . . . . . . . . . . . . . . . . . . ? v to +5 v analog input voltage to agnd 3 . . . . . . ?.3 v to av dd + 0.3 v reference input voltage to agnd . . . . ?.3 v to av dd + 0.3 v ain/refin current (inde nite) . . . . . . . . . . . . . . . . . . 30 ma digital input voltage to dgnd . . . . . . ?.3 v to dv dd + 0.3 v digital output voltage to dgnd . . . . . ?.3 v to dv dd + 0.3 v operating temperature range . . . . . . . . . . . . ?0? to +125? storage temperature range . . . . . . . . . . . . . . ?5? to +150? junction temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . 150? ja thermal impedance (mqfp) . . . . . . . . . . . . . . . . . 90?/w ja thermal impedance (csp base floating) . . . . . . . . 52?/w lead temperature, soldering vapor phase (60 sec) . . . . . . . . . . . . . . . . . . . . . . . . . . 215? infrared (15 sec) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220? notes 1 stresses above those listed under absolute maximum ratings may cause permanent damage to the device. this is a stress rating only; functional operation of the device at these or any other conditions above those listed in the operational sections of this speci cation is not implied. exposure to absolute maximum rating conditions for extended periods may affect device reliability. 2 ag nd and dgnd are shorted internally on the ADUC836. 3 applies to p1.2 to p1.7 pins operating in analog or digital input modes. pin configurations 52-lead mqfp 1 13 14 26 40 52 27 39 ADUC836 top view (not to scale) pin 1 identifier 56-lead csp pin 1 identifier 1 14 15 28 29 42 43 56 ADUC836 top view (not to scale) caution esd (electrostatic discharge) sensitive device. electrostatic charges as high as 4000 v readily ac cu mu late on the human body and test equipment and can discharge without detection. although the ADUC836 features proprietary esd pro tec tion circuitry, permanent damage may occur on devices subjected to high energy electrostatic discharges. therefore, proper esd pre cau tions are rec om mend ed to avoid per for mance deg ra da tion or loss of functionality. rev. 0
ADUC836 ?10? pin function descriptions pin no. pin no. 52-lead 56-lead mqfp csp m nemonic type * description 1, 2 56, 1 p1.0/p1.1 i/o p1.0 and p1.1 can function as digital inputs or digital outputs and have a pull-up con guration as described for port 3. p1.0 and p1.1 have an increased current drive sink capability of 10 ma. p1.0/t2/pwm0 i/o p1.0 and p1.1 also have various sec ond ary functions as described below. p1.0 can be used to pro vide a clock input to timer 2. when enabled, counter 2 is incremented in response to a negative transition on the t2 input pin. if the pwm is enabled, the pwm0 output will appear at this pin. p1.1/t2ex/pwm1 i/o p1.1 can also be used to pro vide a con trol input to timer 2. when enabled, a pwm1 negative transition on the t2ex input pin will cause a timer 2 capture or reload event. if the pwm is enabled, the pwm1 output will appear at this pin. 3?, 2?, p1.2?1.7 i port 1.2 to port 1.7 have no dig i tal out put driver; they can func tion as a digital input 9?2 11?4 for which 0 must be written to the port bit. as a digital in put, these pins must be driven high or low externally. these pins also hav e the following analog functionality: p1.2/dac/iexc1 i/o the voltage out put from the dac or one or both current sources (200 ? or 2 200 ?) can be con g ured to ap pear at this pin. p1.3/ain5/iexc2 i/o auxiliary adc input or one or both current sources can be con g ured at this pin. pll with prog. clock divider watchdog timer 2304 bytes user ram power supply monitor ain3 ain4 ain5 ain1 ain2 refin refin iexc 2 iexc 1 ain mux temp sensor ain mux band gap reference v ref detect current source mux 200 a 200 a 5 av dd 6 agnd 20 21 dgnd 35 26 sclock 27 mosi/sdata 14 miso 13 ss xtal1 p0.0 (ad0) p0.1 (ad1) p0.3 (ad3) p0.4 (ad4) p0.5 (ad5) p0.6 (ad6) p0.7 (ad7) 43 44 45 46 49 50 51 52 p0.2 (ad2) buf ADUC836 auxiliary adc 16-bit - adc adc control and calibration pga primary adc 16-bit - adc adc control and calibration 3 22 t0 23 t1 2 t2ex t2 1 int0 int1 dac 40 ea 41 psen 17 txd 16 rxd 4 kbytes data flash/ee 62 kbytes program/ flash/ee uart serial port 8052 mcu core downloader debugger buf single-pin emulator spi/i 2 c serial interface 16-bit counter timers wake-up/ rtc timer xtal2 33 osc p1.0 (t2) p1.1 (t2ex) p1.2 (dac/iexc 1) p1.4 (ain1) p1.5 (ain2) p1.6 (ain3) p1.7 (ain4/dac) p1.3 (ain5/iexc 2) 1 2 3 4 9 10 11 12 p2.0 (a8/a16) p2.1 (a9/a17) p2.2 ( a10/a18) p2.3 (a11/a19) p2.4 ( a12/a20) p2.5 ( a13/a21) p2.6 ( a14/a22) p2.7 ( a15/a23) 28 29 30 31 36 39 38 37 16 p3.0 (rxd) 17 p3.1 (txd) 18 p3.2 ( int0 ) 19 p3.3 ( int1 ) 22 p3.4 (t0/pwmclk) 23 p3.5 (t1) 24 25 p3.7 ( rd ) p3.6 ( wr ) 12-bit voltage output dac 2 data pointers 11-bit stack pointer pwm0 pwm1 pwm control 1 2 32 42 ale 15 reset 48 dv dd 34 47 uart timer * pin numbers refer to the 52-lead mqfp package shaded areas represent the new features of the ADUC836 over the aduc816 dual 16-bit - dac dual 16-bit pwm mux dac control por 18 19 figure 1. detailed block diagram rev. 0
ADUC836 ?11? pin function descriptions (continued) pin no. pin no. 52-lead 56-lead mqfp csp mnemonic type * description p1.4/ain1 i primary adc, positive analog input p1.5/ain2 i primary adc, negative analog input p1.6/ain3 i auxiliary adc input or muxed primary adc, positive analog in put p1.7/ain4/dac i/o auxiliary adc input or muxed primary adc, neg a tive an a log input. the volt age output from the dac can also be con g ured to appear at this pin. 5 4, 5 av dd s an a log supply voltage, 3 v or 5 v 6 6, 7, 8 agnd s an a log ground. ground reference pin for the analog circuitry. 7 9 refin(? i reference input, negative terminal 8 10 refin(+) i reference input, positive terminal 13 15 ss i slave select input for the spi interface. a weak pull-up is present on this pin. 14 16 miso i/o master input/slave output for the spi interface. a weak pull-up is present on this input pin. 15 17 reset i reset input. a high level on this pin for 16 core clock cycles w hile the oscillator is ru nning resets the device. there is an internal weak pull-down and a schmitt trigger input stage on this pin. 16?9, 18?1, p3.0?3.7 i/o p3.0?3.7 are bidirectional port pins with internal pull-up resistors. po rt 3 pins that 22?5 24?7 have 1s written to them are pulled high by the internal pull- up resistors, and in that state can be used as inputs. as inputs, port 3 pin s being pulled externally low will source cur rent because of the internal pull-up resistors. when driv ing a 0-to-1 output transition, a strong pull-up is active for two cor e clock periods of the instruction cycle. port 3 pins also have various sec ond ary functions including: p3.0/rxd i/o receiver data for uart serial port p3.1/txd i/o transmitter data for uart serial port p3.2/ int0 i/o external interrupt 0. this pin can also be used as a gate control input to timer 0. p3.3/ int1 i/o external interrupt 1. this pin can also be used as a gate control input to timer 1. p3.4/t0/pwmclk i/o timer/counter 0 external input. if the pwm is enabled, an external clock may be input at this pin. p3.5/t1 i/o timer/counter 1 external input p3.6/ wr i/o external data memory write strobe. latches the data byte from port 0 into an external data mem o ry. p3.7/ rd i/o external data memory read strobe. enables the data from an ex ter nal data memory to port 0. 20, 34, 48 22, 36, 51, dv dd s digital supply, 3 v or 5 v 21, 35, 47 23, 37, 38, dgnd s digital ground. ground reference point for the digital circuitry. 50 26 sclock i/o serial interface clock for either the i 2 c or spi interface. as an input, this pin is a schmitt-triggered input, and a weak in ter nal pull-up is present on this pin unless it is outputting logic low. this pin can also be directly controlled in software as a digital output pin. 27 mosi/sdata i/o serial data i/o for the i 2 c interface or master output/slave input for the spi interface. a weak internal pull-up is present on this pin unless it is out put ting logic low. this pin can also be directly controlled in software as a digital out put pin. 28?1 30?3 p2.0?2.7 i/o port 2 is a bidirectional port with internal pull-up resistors. port 2 p ins that have 1s 36?9 39?2 (a8?15) writ ten to them are pulled high by the internal pull-up re sis tors, and in that state can (a16?23) be used as inputs. as inputs, port 2 pins being pulled ex ter nal ly low will source current because of the in ter nal pull-up resistors. po rt 2 emits the high order address bytes during f etch es from external program memory and middle and high order address bytes durin g accesses to the 24-bit external data memory space. 32 34 xtal1 i input to the crystal oscillator inverter 33 35 xt al2 o output from the crystal oscillator inverter. (see the hardware des ign con siderations section for description.) rev. 0
ADUC836 ?12? pin function descriptions (continued) pin no. pin no. 52-lead 56-lead mqfp csp mnemonic type * description 40 43 ea i/o external access en able, logic input. when held high, this input enables the de vice to fetch code from internal program memory locations 0000h to f7ffh. when held low, this input enables the device to fetch all in struc tions from ex ter nal program memory. to de ter mine the mode of code ex e cu tion, i.e., in ter nal or external, the ea pin is sampled at the end of an ex ter nal re set as ser tion or as part of a device power cycle. ea may also be used as an external emulation i/o pin, and therefore the voltage level at this pin must not be changed dur ing nor mal mode op er a tion as it may cause an emulation interrupt that will halt code execution. 41 44 psen o program store enable, logic output. this output is a control signal that enables the external program memory to the bus during external fetch op er a tions. it is active every six oscillator periods except dur ing ex ter nal data mem o ry accesses. this pin remains high during internal program ex e cu tion. psen can also be used to enable serial download mode when pulled low through a resistor at the end of an external reset assertion or as part of a device power cycle. 42 45 ale o address latch enable, logic output. this output is used to latc h the low byte (and page byte for 24-bit data address space accesses) of the address to external mem o ry during external code or data memory access cycles. it is activated every six oscillator periods except during an ex ter nal data mem o ry access. it can be disabled by setting the pcon.4 bit in the pcon sfr. 43?6 46?9 p0.0?0.7 i/o these pins are part of port 0, which is an 8-bit, open-drain, bi di rec tion al 49?2 52?5 (ad0?d3) i/o port. port 0 pins that have 1s written to them oat and in that state can be used (ad4?d7)a s high im ped ance inputs. an external pull-up resistor will be required on p0 outputs to force a valid logic high level ex ter nal ly. port 0 is also the mul ti plexed low order address and data bus dur ing ac cess es to external pro g ram or data mem o ry. in this application, it uses strong internal pull-ups when emitting 1s. * i = input, o = output, s = supply. rev. 0
ADUC836 ?13? memory organization the ADUC836 contains four different memory blocks: 62 kbytes of on-chip flash/ee program memory 4 kbytes of on-chip flash/ee data memory 256 bytes of general-purpose ram 2 kbytes of internal xram (1) flash/ee program memory the ad uc836 p rovides 62 kbytes of flash/ee program mem- o ry to run user code. the user can choose to run code from this internal memory or run code from an external pro g ram memory. if the user applies power or resets the device while the ea pin is pulled low externally, the part will execute code from the ex ter nal program space; otherwise, if ea is pulled high externally, the part defaults to code execution from its internal 62 kbytes of flash/ee program memory. unlike the aduc816, where code execution can over ow from the internal code space to external code space once the pc becomes g reater than 1fffh, the ADUC836 does not support the rollover from f7ffh in internal code space to f800h in external code space. instead, the 2048 bytes between f800h and ffffh will appear as nop instructions to user code. pe r manently embedded rm w are allows code to be serially down- loaded to the 62 kbytes of internal code space via the uart serial port while the device is in-circuit. no external hardware is required. 56 kbytes of the program memory can be reprogrammed dur ing r untime; thus the code space can be upgraded in the eld using a user de ned protocol or it can be used as a data mem o ry . this is discussed in more detail in the flash/ee memory section. (2) flash/ee data memory 4 kb ytes of flash/ee data memory are available to the user and can be accessed indirectly via a group of registers mapped into the special function register (sfr) area. access to the flash/ee data memory is discussed in detail in the flash/ee memory section. (3) general-purpose ram the general-purpose ram is divided into two separate mem o r ies: the upper and lower 128 bytes of ram. the lower 128 bytes of ram can be accessed through direct or indirect addressing; the upper 128 bytes of ram can only be accessed through indirect addressing as it shares the same address space as the sfr space, which can only be accessed through direct addressing. the lower 128 bytes of internal data memory are mapped as shown in figure 2. the lowest 32 bytes are grouped into four banks of eight registers addressed as r0 through r7. the next 16 bytes (128 bits), locations 20h through 2fh above the register banks, form a block of directly addressable bit locations at bit addresses 00h through 7fh. the stack can be located anywhere in the inter- nal memory address space, and the stack depth can be expanded up to 2048 bytes. reset initializes the stack pointer to location 07h. any call or push pre-increments the sp before loading the stack. therefore, loading the stack starts from location 08h, which is also the rs t register (r0) of register bank 1. thus, if one is going to use more than one register bank, the stack pointer should be ini tial ized to an area of ram not used for data stor age. bit-addressable (bit addresses) four banks of eight registers r0?7 banks selected via bits in psw 11 10 01 00 07h 0fh 17h 1fh 2fh 7fh 00h 08h 10h 18h 20h reset value of stack pointer 30h general-purpose area figure 2. lower 128 bytes of internal data memory (4) internal xram the ADUC836 contains 2 kbytes of on-chip extended data mem- o ry . this memory, although on-chip, is accessed via the movx instruction. the 2 kbytes of internal xram are mapped into the bottom 2 kbytes of the external address space if the cfg836.0 bit is set. otherwise, access to the external data mem o ry will occur just like a standard 8051. even with the cfg836.0 bit set, access to the external xram will occur once the 24-bit dptr is greater than 0007ffh. external data memory space (24-bit address space) 000000h ffffffh cfg836.0 = 0 external data memory space (24-bit address space) 000000h ffffffh cfg836.0 = 1 0007ffh 000800h 2 kbytes on-chip xram figure 3. internal and external xram general notes pertaining to this data sheet 1. set im plies a logic 1 state and cleared implies a logic 0 state, unless otherwise stated. 2. set and cleared also imply that the bit is set or automatically cleared by the ADUC836 hardware, unless otherwise stated. 3. user software should not write 1s to reserved or unimplemented bits as they may be used in future products. 4. any pin numbers used throughout this data sheet refer to the 52-lead mqfp package, unless otherwise stated. rev. 0
ADUC836 ?14? when accessing the internal xram, the p0 and p2 port pins, as w ell as the rd and wr strobes, will not be output as per a stan- dard 8051 movx instruction. this allows the user to use these port pins as standard i/o. the upper 1792 bytes of the internal xram can be con gured to be used as an extended 11-bit stack pointer. by default, the stack will operate exactly like an 8052 in that it will roll over from ffh to 00h in the general-purpose ram. on the ADUC836 however, it is possible (by setting cfg836.7) to enable the 11-bit extended stack pointer. in this case, the stack will roll over from ffh in ram to 0100h in xram. the 11-bit stack pointer is visible in the sp and sph sfrs. the sp sfr is located at 81h as with a standard 8052. the sph sfr is lo cat ed at b7h. the 3 lsbs of this sfr contain the three extra bits nec es sary to ex tend the 8-bit stack point er into an 11-bit stack point er. upper 1792 bytes of on-chip xram (data + stack for exsp = 1, data only for exsp = 0) 256 bytes of on-chip data ram (data + stack) lower 256 bytes of on-chip xram (data only) 00h ffh 00h 07ffh cfg836.7 = 0 cfg836.7 = 1 100h figure 4. extended stack pointer operation external data memory (external xram) just like a standard 8051 compatible core, the ADUC836 can access external data memory using a movx instruction. the movx instruction automatically outputs the various control strobes required to access the data memory. the ADUC836, however, can access up to 16 mbytes of external data memory. this is an enhancement of the 64 kbytes external data memory space available on a standard 8051 compatible core. the external data memory is discussed in more detail in the ADUC836 hardware design considerations section. special function registers (sfrs) the sfr space is mapped into the upper 128 bytes of internal data memory space and accessed by direct addressing only. it provides an interface between the cpu and all on-chip pe riph - er als. a block diagram showing the programming model of the ADUC836 via the sfr area is shown in figure 5. 128-byte special function register area 62 kbyte electrically reprogrammable nonvolatile flash/ee program memory 8051 compatible core other on-chip peripherals temp sensor current sources 12-bit dac serial i/o wdt, psm tic, pll dual - adcs 4 kbyte electrically reprogrammable nonvolatile flash/ee data memory 256 bytes ram 2k xram figure 5. programming model all registers, except the program counter (pc) and the four gen er al-purpose register banks, reside in the sfr area. the sfr registers include control, con guration, and data registers that provide an interface between the cpu and all on-chip pe riph er als. accumulator sfr (acc) a cc is the accumulator register, which is used for math op er a tions including addition, subtraction, integer multiplication, and division, and boolean bit ma nip u la tions. the mnemonics for accumulator-speci c instructions, refer to the accumulator as a. b sfr (b) the b register is used with the acc for multiplication and division operations. for other instructions, it can be treated as a general-purpose scratch pad register. data pointer (dptr) the data pointer is made up of three 8-bit registers, named dpp (page byte), dph (high byte), and dpl (low byte). these are used to provide memory addresses for internal and external code access and external data access. it may be manipulated as a 16-bit register (dptr = dph, dpl), although inc dptr instructions will automatically carry over to dpp, or as three independent 8-bit registers (dpp, dph, dpl). the ADUC836 supports dual data pointers. for more information, refer to the dual data pointer section. rev. 0
ADUC836 ?15? ta b le ii. pcon sfr bit designations bit name description 7 smod double uart baud rate 6 seripd spi power-down interrupt enable 5 int0pd int0 power-down interrupt enable 4 aleoff disable ale output 3 gf1 general-purpose flag bit 2 gf0 general-purpose flag bit 1 pd power-down mode enable 0 idl idle mode enable ADUC836 configuration sfr (cfg836) the cfg836 sfr contains the necessary bits to con gure the internal xram and the extended sp. by default it con g ures the user into 8051 mode, i.e., extended sp is disabled, internal xram is disabled. sfr address afh po w er-on default value 00h bit addressable no ta b le iii. cfg836 sfr bit designations bit name description 7 exsp extended sp enable. if this bit is set, the stack will roll over from sph/sp = 00ffh to 0100h. if this bit is clear, the sph sfr will be dis abled and the stack will roll over from sp = ffh to sp = 00h. 6 reserved for future use 5 reserved for future use 4 reserved for future use 3 reserved for future use 2 reserved for future use 1 reserved for future use 0 xramen xram enable bit. if this bit is set, the in- ter nal xram will be mapped into the lower 2 kbytes of the external address space. if this bit is clear, the inter nal xram will not be accessible and the external data memory will be mapped into the lower 2 kbytes of external data memory (see figure 3). stack pointer (sp and sph) the sp sfr is the stack pointer and is used to hold an internal ram address that is called the ?op of the stack. the sp reg is ter is incremented before data is stored, during push and call executions. while the stack ma y reside anywhere in on-chip ram, the sp register is initialized to 07h after a reset. this causes the stack to begin at location 08h. as mentioned earlier, the ADUC836 offers an extended 11-bit stack pointer. the t hree extra bits that make up the 11-bit stack point er are the 3 lsbs of the sph byte located at b7h. program status word (psw) the psw sfr contains several bits re ecting the current status of the cpu as detailed in table i. sfr address d0h po w er-on default value 00h bit addressable yes ta b le i. psw sfr bit designations bit name description 7 cy carry flag 6 ac auxiliary carry flag 5 f0 general-purpose flag 4 rs1 register bank select bits 3 rs0 rs1 rs0 selected bank 0 0 0 0 1 1 1 0 2 1 1 3 2 ov over ow flag 1 f1 general-purpose flag 0 p parity bit po w er control sfr (pcon) the pcon sfr contains bits for power saving options and general-purpose status ags, as shown in table ii. the tic (wake-up/rtc timer) can be used to accurately wake up the ADUC836 from power-down at regular intervals. to use the tic to wake up the ADUC836 from power-down, the osc_pd bit in the pllcon sfr must be clear and the tic must be enabled. sfr address 87h po w er-on default value 00h bit addressable no rev. 0
ADUC836 ?16? spicon f8h 04h reserved reserved reserved reserved reserved reserved not used reserved reserved reserved reserved reserved reserved reserved reserved reserved reserved reserved reserved reserved reserved reserved reserved not used reserved reserved reserved reserved reserved dacl fbh 00h dach fch 00h daccon fdh 00h b f0h 00h i2ccon e8h 00h acc e0h 00h adcstat d8h 00h psw d0h 00h t2con 00h wdcon c0h 10h ip b8h 00h p3 b0h ffh ie a8h 00h p2 a0h ffh scon 98h 00h p1 90h ffh tcon 88h 00h p0 80h ffh adcmode d1h 00h econ b9h 00h ieip2 a9h a0h timecon a1h 00h sbuf 99h 00h tmod 89h 00h sp 81h 07h eah 55h of0m e2h 00h adc0m dah 00h adc0con d2h 07h rcap2l cah 00h chipid c2h 2 h hthsec a2h 00h tl0 8ah 00h dpl 82h 00h ebh 53h of0h e3h 80h adc0h dbh 00h adc1con d3h 00h rcap2h cbh 00h sec a3h 00h tl1 8bh 00h dph 83h 00h reserved reserved reserved reserved reserved gn1l ech 9ah of1l e4h 00h adc1l dch 00h sf d4h 45h tl2 cch 00h edata1 bch 00h min a4h 00h th0 8ch 00h dpp 84h 00h reserved gn1h edh 59h of1h e5h 80h adc1h ddh 00h icon d5h 00h th2 cdh 00h edata2 bdh 00h hour a5h 00h th1 8dh 00h reserved eadrl c6h 00h edata3 beh 00h intval a6h 00h spidat f7h 00h psmcon dfh deh pllcon d7h 03h edata4 bfh 00h pcon 87h 00h gn0m gn0h c8h pwmcon cfg836 dpcon sph pwm0l pwm0h pwm1l pwm1h b1h 00h b4h 00h b3h 00h b2h 00h b7h 00h afh 00h aeh 00h a7h 00h eadrh c7h 00h t3con 9eh 00h reserved reserved t3fd 9dh 00h reserved reserved reserved reserved reserved reserved reserved reserved 22 2 2 11 11 ispi ffh 0 wcol feh 0 spe fdh 0 spim fch 0 cpol fbh 0 cpha fah spr1 f9h 0 spr0 f8h 0 bits f7h 0 f6h 0 f5h 0 f4h 0 f3h 0 f2h f1h 0 f0h 0 bits mdo efh 0 eeh 0 edh 0 ech 0 i2cm ebh 0 eah e9h 0 e8h 0 bits e7h 0 e6h 0 e5h 0 e4h 0 e3h 0 e2h e1h 0 e0h 0 bits rdy0 dfh 0 rdy1 deh 0 cal ddh 0 noxref dch 0 err0 dbh 0 err1 dah d9h 0 d8h 0 bits cy d7h 0 ac d6h 0 f0 d5h 0 rsi d4h 0 rs0 d3h 0 ov d2h fi d1h 0 p d0h 0 bits tf2 cfh 0 exf2 ceh 0 rclk cdh 0 tclk cch 0 exen2 cbh 0 tr2 cah cnt2 c9h 0 cap2 c8h 0 bits pre2 c7h 0 pre1 c6h 0 pre0 c5h 0 c4h 1 wdir c3h 0 wds c2h wde c1h 0 wdwr c0h 0 bits bfh 0 padc beh 0 pt2 bdh 0 ps bch 0 pt1 bbh 0 px1 bah pt0 b9h 0 px0 b8h 0 bits rd b7h 1 wr b6h 1 t1 b5h 1 t0 b4h 1 int1 b3h 1 int0 b2h txd b1h 1 rxd b0h 1 bits ea afh eadc aeh et2 adh es ach 0 et1 abh 0 ex1 aah et0 a9h 0 ex0 a8h 0 bits a7h a6h a5h 1 a4h 1 a3h 1 a2h a1h 1 a0h 1 bits sm0 9fh 0 sm1 9eh 0 sm2 9dh 0 ren 9ch 0 tb8 9bh 0 rb8 9ah t1 99h 0 r1 98h 0 bits 97h 1 96h 1 95h 1 94h 1 93h 1 92h t2ex 91h 1 t2 90h 1 bits tf1 8fh 0 tr1 8eh 0 tf0 8dh 0 tr0 8ch 0 ie1 8bh 0 it1 8ah ie0 89h 0 it0 88h 0 bits 87h 1 86h 1 85h 1 84h 1 83h 1 82h 81h 1 80h 1 bits 1 1 0 1 0 1 1 0 0 0 0 0 0 0 pre3 000 0 11 mde mco mdi i2crs i2ctx i2ci ie0 89h 0 it0 88h 0 tcon 88h 00h bit mnemonic bit bit address mnemonic reset default value sfr address these bits are contained in this byte. reset default bit value sfr map key: sfr note: sfrs whose addresses end in 0h or 8h are bit addressable. notes 1 calibration coefficients are preconfigured at power-up to factory calibrated values. 2 these sfrs maintain their prereset values after a reset if timecon.0 = 1. reserved reserved reserved figure 6. special function register locations and their reset default values complete sfr map figure 6 shows a full sfr memory map and the sfr con- tents after reset. not used indicates unoccupied sfr locations. unoccupied locations in the sfr address space are not im ple ment ed, i.e., no register exists at this location. if an unoccupied location is read, an unspeci ed value is returned. sfr locations that are reserved for future use are shaded (re served) and should not be accessed by user software. rev. 0
ADUC836 ?17? adc sfr interface both adcs are controlled and con gured via a number of sfrs that are s ummarized here and described in more detail in the fol low ing sections. adcstat adc status register. holds general status of the primary and auxiliary adcs. adcmode adc mode register. controls general modes of operation for primary and auxiliary adcs adc0con primary adc control register. controls speci c con guration of primary adc. adc1con auxiliary adc control register. controls speci c con guration of auxiliary adc. sf sinc filter register. con g ures the dec ima tion f actor for the sinc 3 lter and thus the pri ma ry and aux il ia ry adc update rates. icon current source control register. al lows the user to control of the various on-chip cur rent source options. adc0m/h primary adc 16-bit con ver sion result is held in these two 8-bit registers. adc1l/h auxiliary adc 16-bit conversi on result is held in these two 8-bit registers. of0m/h primary adc 16-bit offset calibration coef cient is held in these two 8-bit reg is ters. of1l/h auxiliary adc 16-bit offset calibration coef cient is held in these two 8-bit reg is ters. gn0m/h primary adc 16-bit gain calibration coef cient is held in these two 8-bit reg is ters. gn1l/h auxiliary adc 16-bit gain calibration coef cient is held in these two 8-bit registers. adcstat (adc status register) this sfr re ects the status of both adcs including data ready, calibration, and various (adc related) error and warning conditions such as reference detect and conversion over o w/under ow ags. sfr address d8h po w er-on default value 00h bit addressable yes ta b le iv. adcstat sfr bit designations bit name description 7 rdy0 ready bit for primary adc. set by hardware on completion of adc conversion or calibration cy cle. cleared directly by the user or indirectly by writing to the mode bits to start another primary adc conver sion or calibration. the primary adc is in hib it ed from writing further results to its data or cal i bra tion registers until the rdy0 bit is cleared. 6 rdy1 ready bit for auxiliary adc. same de nition as rdy0 referred to the auxiliary adc. 5 cal calibration status bit. set by hardware on com ple tion of cal i bra tion. cleared indirectly by a write to the mode bits to start an oth er adc con ver sion or calibration. 4 noxref no ex ter nal reference bit (only active if primary or auxiliary adc is active) . set to indicate that one or both of the refin pins is oat ing or the applied voltage is below a speci ed threshold. when set, con ver sion results are clamped to all ones, if using external reference. cleared to indicate valid v ref . 3 err0 primary adc error bit. set by hardware to indicate that the result written to the primary adc data reg is ters has been clamped to all zeros or all ones. after a calibration, this bit also ags error con di tions that caused the calibration registers not to be writ ten. cleared by a write to the mode bits to initiate a con ver sion or cal i bra tion. 2 err1 auxiliary adc error bit. same de nition as err0 referred to the auxiliary adc. 1 reserved for future use 0 reserved for future use rev. 0
ADUC836 ?18? adcmode (adc mode register) used to control the operational mode of both adcs. sfr address d1h po w er-on default value 00h bit addressable no ta b le v. adcmode sfr bit designations bit name description 7 reserved for future use 6 reserved for future use 5 adc0en primary adc enable. set by the user to enable the primary adc and place it in the mode selected in md2?d0, below. cleared by the user to place the primary adc in power-down mode. 4 adc1en auxiliary adc enable. set by the user to enable the auxiliary adc and place it in the mode selected in md2?d0, below. cleared by the user to place the auxiliary adc in power-down mode. 3 reserved for future use 2 md2 primary and auxiliary adc mode bits. 1 md1 these bits select the operational mode of the enabled adc as follows: 0 md0 md2 md1 md0 0 0 0 adc power-down mode (power-on default) 0 0 1 idle mode. the adc lter and modulator are held in a reset state although the modulator clocks are still pro vid ed. 0 1 0 single conversion mode. a single con ver sion is performed on the enabled adc. on completion of the conversion, the adc data registers (adc0h/m and/or adc1h/l) are up dat ed, the relevant ags in the adcstat sfr are writ ten, and power-down is re-entered with the md2?d0 ac cord ing ly being written to 000. 0 1 1 con tin u ous conversion. the adc data registers are reg u lar ly updated at the selected update rate (see sf register). 1 0 0 internal zero-scale calibration. internal short automatically connected to the enabled adc input(s). 1 0 1 in ter nal full-scale calibration. internal or external v ref (as determined by xref0 and xref1 bits in adc0/1con) is automatically connected to the enabled adc input(s) for this cal i bra tion. 1 1 0 system zero-scale calibration. user should connect system zero-scale input to the enabled adc input(s) as selected by ch1/ch0 and ach1/ach0 bits in the adc0/1con register. 1 1 1 system full-scale calibration. user should connect system full-scale input to the enabled adc input(s) as selected by the ch1/ch0 and ach1/ach0 bits in the adc0/1con register. notes 1. any change to the md bits will immediately reset both adcs. a write to the md2? bits with no change is also treated as a res et. (see exception to this in note 3.) 2. if adc0con is written when adc0en = 1, or if adc0en is changed from 0 to 1, then both adcs are also immediately reset. in ot her words, the primary adc is gi v en priority over the auxiliary adc, and any change requested on the primary adc is immediately responded to. 3. on the other hand, if adc1con is written or if adc1en is changed from 0 to 1, only the auxiliary adc is reset. for example, i f the primary adc is con tin u ous ly converting when the auxiliary adc change or enable occurs, the primary adc continues undisturbed. rather than allow the auxiliary adc to o p er a te with a phase difference from the primary adc, the auxiliary adc will fall into step with the outputs of the pri ma ry adc. the result is that the rst con ver sion time for the auxiliary adc will be delayed up to three outputs while the auxiliary adc update rate is syn chro nized to the pri ma ry adc. 4. once adcmode has been written with a calibration mode, the rdy0/1 bits (adcstat) are im me di a te ly reset and the calibration commences. on com ple tion, the appropriate calibration registers are written, the relevant bits in adcstat are written, and the md2? bits are reset to 000 to indicate th e adc is back in power-down mode. 5. any calibration request of the auxiliary adc while the temperature sensor is selected will fail to complete. although the rd y1 bit will be set at the end of the calibration c ycle, no update of the calibration sfrs will take place and the err1 bit will be set. 6. calibrations are performed at maximum sf (see sf sfr) value, guaranteeing optimum calibration operation. rev. 0
ADUC836 ?19? adc0con (primary adc control register) and adc1con (auxiliary adc control register) the adc0con and adc1con sfrs are used to con gure the primary and auxiliary adc for reference and channel selection, unipolar or bipolar coding and, in the case of the primary adc, range (the auxiliary adc operates on a x ed input range of ? ref ). adc0con primary adc control sfr sfr address d2h po w er-on default value 07h bit addressable no adc1con auxiliary adc con trol sfr sfr ad dress d3h po w er-on default value 00h bit addressable no ta b le vi. adc0con sfr bit designations bit name description 7 reserved for future use 6 xref0 primary adc ex ter nal reference select bit. set by user to enable the primary adc to use the external reference via re fin(+)/refin(?. cleared by user to enable the primary adc to use the internal band gap ref er ence (v ref = 1.25 v). 5 ch1 primary adc chan nel selection bits. 4 ch0 written by the user to select the dif fer en tial input pairs used by the primary adc as follows: ch1 ch0 positive input negative input 0 0 ain1 ain2 0 1 ain3 ain4 1 0 ain2 ain2 (internal short) 1 1 ain3 ain2 3 uni0 primary adc un i po lar bit. set by user to enable unipolar coding, i.e., zero differential input will result in 000000h out put. cleared by user to enable bipolar coding, i.e., zero differential input will result in 800000h out put. 2 rn2 primary adc range bits. 1 rn1 written by the user to select the primary adc input range as follows: 0 rn0 rn2 rn1 rn0 selected primary adc input range (v ref = 2.5 v) 0 0 0 ?0 mv (0 mv?0 mv in unipolar mode) 0 0 1 ?0 mv (0 mv?0 mv in unipolar mode) 0 1 0 ?0 mv (0 mv?0 mv in unipolar mode) 0 1 1 ?60 mv (0 mv?60 mv in unipolar mode) 1 0 0 ?20 mv (0 mv?20 mv in unipolar mode) 1 0 1 ?40 mv (0 mv?40 mv in unipolar mode) 1 1 0 ?.28 v (0 v?.28 v in unipolar mode) 1 1 1 ?.56 v (0 v?.56 v in unipolar mode) ta b le vii. adc1con sfr bit designations bit name description 7 reserved for future use 6 xref1 auxiliary adc ex ter nal reference bit. set by user to enable the auxiliary adc to use the external reference via refin(+)/refin(?. cleared by user to enable the auxiliary adc to use the internal band gap reference. 5 ach1 auxiliary adc chan nel selection bits. 4 ach0 written by the user to select the single-ended input pins used to drive the auxiliary adc as fol lows: a ch1 ach0 positive input negative input 0 0 ain3 agnd 0 1 ain4 agnd 1 0 temp sensor agnd (temp sensor routed to the adc input) 1 1 ain5 agnd 3 uni1 auxiliary adc un i po lar bit. set by user to enable unipolar coding, i.e., zero input will result in 0000h output. cleared by user to enable bipolar coding, i.e., zero input will result in 8000h output. 2 reserved for future use 1 reserved for future use 0 reserved for future use notes 1. when the temperature sensor is selected, user code must select internal reference via xref1 bit above and clear the uni1 bit (adc1con.3) to select bipolar coding. 2. the temperature sensor is factory calibrated to yield conversion results 8000h at 0?. 3. a +1? change in temperature will result in a +1 lsb change in the adc1h register adc conversion result. rev. 0
ADUC836 ?20? adc0h/adc0m (primary adc conversion result reg is ters) these two 8-bit registers hold the 16-bit conversion result from the primary adc. sfr address adc0h high data byte dbh adc0m middle data byte dah po w er-on default value 00h adc0h, adc0m bit addressable no adc0h, adc0m adc1h/adc1l (auxiliary adc conversion result registers) these two 8-bit registers hold the 16-bit conversion result from the auxiliary adc. sfr address adc1h high data byte ddh adc1l low data byte dch po w er-on default value 00h adc1h, adc1l bit addressable no adc1h, adc1l of0h/of0m (primary adc offset calibration registers * ) these two 8-bit registers hold the 16-bit offset calibration coef cient for the primary adc. these registers are con gured at pow er-on with a factory default value of 800000h. how ev er, these bytes will be au to mat i cal ly overwritten if an internal or sys tem zero-scale calibration of the primary adc is initiated by the user via md2? bits in the adcmode register. sfr address of0h primary adc offset coef cient high byte e3h of0m primary adc offset coef cient middle byte e2h po w er-on default value 80000h of0h, of0m respectively bit addressable no of0h, of0m of1h/of1l (auxiliary adc offset calibration registers * ) these two 8-bit registers hold the 16-bit offset calibration coef cient for the auxiliary adc. these registers are con g ured at pow er-on with a factory default value of 8000h. how ev er, these bytes will be au to mat i cal ly overwritten if an internal or system zero-scale cal i bra tion of the auxiliary adc is initiated by the user via the md2? bits in the adcmode register. sfr address of1h auxiliary adc offset coef cient high byte e5h of1l aux il ia ry adc offset co ef cient low byte e4h po w er-on default value 8000h of1h and of1l, respectively bit addressable no of1h, of1l gn0h/gn0m (primary adc gain calibration registers * ) these two 8-bit registers hold the 16-bit gain cal i bra tion coef cient for the primary adc. these registers are con g ured at pow er-on with a factory-calculated internal full-scale calibration coef cient. every device will have an individual coef cient. how ev er, these bytes will be au to mat i cal ly overwritten if an internal or sys tem full-scale calibration of the primary adc is initiated by the user via md2? bits in the adcmode register. sfr address gn0h primary adc gain coef cient high byte ebh gn0m pri ma ry adc gain coef cient middle byte eah po w er-on default value con g ured at factory final test; see notes above. bit addressable no gn0h, gn0m gn1h/gn1l (auxiliary adc gain calibration registers * ) these two 8-bit registers hold the 16-bit gain calibration coef cient for the auxiliary adc. these registers are con g ured at power-on with a factory-calculated internal full-scale cal i bra tion coef cient. every device will have an individual coef cient. however, these bytes will be au to mat i cal ly overwritten if an internal or system full-scale calibration of the auxiliary adc is initiated by the user via md2? bits in the adcmode register. sfr address gn1h auxiliary adc gain coef cient high byte edh gn1l auxiliary adc gain coef cient low byte ech po w er-on default value con g ured at factory final test; see notes above. bit addressable no gn1h, gn1l * these registers can be overwritten by user software only if mode bits md0? (adcmode sfr) are zero. rev. 0
ADUC836 ?21? sf (sinc filter register) the number in this register sets the decimation factor and thus the output update rate for the primary and auxiliary adcs. this sfr cannot be written by user software while either adc is active. the update rate applies to both primary and auxiliary adcs and is calculated as follows: f sf f adc m o = 1 3 1 8 where: f adc = adc output up date rate f mod = modulator clock frequency = 32.768 khz sf = decimal value of sf register the allowable range for sf is 0dh to ffh. examples of sf v alues and cor re spond ing conversion update rates ( f adc ) and con- ve r sion times (t adc ) are shown in table viii. the pow er-on default v alue for the sf register is 45h, resulting in a default adc update rate of just under 20 hz. both adc inputs are chopped to mini- mize offset errors, which means that the settling time for a single conversion, or the time to a r st conversion result in continuous conversion mode, is 2 t adc . as men tioned earlier, all calibra- tion cycles will be carried out au to mat i cal ly with a max i mum, i.e., ffh, sf value to ensure op ti mum cal i bra tion per for mance. once a calibration cycle has com plet ed, the value in the sf register will be that programmed by user software. ta bl e viii. sf sfr bit designations sf(dec) sf(hex) f adc (hz) t adc (ms) 13 0d 105.3 9.52 69 45 19.79 50.34 255 ff 5.35 186.77 icon (current sources control register) the icon sfr is used to control and con gure the various excitation and burnout current source op tions available on-chip. sfr address d5h po w er-on default value 00h bit addressable no ta bl e ix. icon sfr bit designations bit name description 7 reserved for future use 6 bo burnout current enable bit. set by user to enable both transducer burnout current sources in the primary adc signal paths. cleared by the user to disable both transducer burnout current sources. 5 adc1ic auxiliary adc current correction bit. set by user to allow scaling of the auxiliary adc by an inter nal current source calibration word. 4 adc0ic primary adc current correction bit. set by user to allow scaling of the primary adc by an internal current source calibration word. 3 i2pin * current source-2 pin select bit. set by user to enable current source-2 (200 a) to external pin 3 (p1.2/dac/iexc1). cleared by user to enable current source-2 (200 a) to external pin 4 (p1.3/ain5/iexc2). 2 i1pin * current source-1 pin select bit. set by user to enable current source-1 (200 a) to external pin 4 (p1.3/ain5/iexc2). cleared by user to enable current source-1 (200 a) to external pin 3 (p1.2/dac/iexc1). 1 i2en current source-2 enable bit. set by user to turn on excitation current source-2 (200 a). cleared by user to turn off excitation current source-2 (200 a). 0 i1en current source-1 enable bit. set by user to turn on excitation current source-1 (200 a). cleared by user to turn off excitation current source-1 (200 a). * both current sources can be enabled to the same external pin, yielding a 400 a current source. rev. 0
ADUC836 ?22? primary and auxiliary adc noise performance t ables x, xi, and xii show the output rms noise in mv and output peak-to-peak resolution in bits (rounded to the nearest 0.5 lsb) for some typical output update rates on both the pri ma ry and auxiliary adcs. the numbers are typical and are generated at a differential input voltage of 0 v. the output up date rate is selected via the sinc filter (sf) sfr. it is im por tant to note that the peak-to-peak resolution gures represent the resolution for which there will be no code icker within a six-sigma limit. the quickstart development system pc software comes com- plete with an adc noise evaluation tool. this tool can be easily used with the evaluation board to see these gures from silicon. ta bl e x. primary adc, typical output rms noise ( v) ty pical output rms noise vs. input range and update rate; output rms noise in v sf data update input range w ord rate (hz) 20 mv 40 mv 80 mv 160 mv 320 mv 640 mv 1.28 v 2.56 v 13 105.3 1.50 1.50 1.60 1.75 3.50 4.50 6.70 11.75 69 19.79 0.60 0.65 0.65 0.65 0.65 0.95 1.40 2.30 255 5.35 0.35 0.35 0.37 0.37 0.37 0.51 0.82 1.25 ta b le xi. primary adc, peak-to-peak resolution (bits) p eak-to-peak resolution vs. input range and update rate; peak-to-peak resolution in bits sf data update input range w ord rate (hz) 20 mv 40 mv 80 mv 160 mv 320 mv 640 mv 1.28 v 2.56 v 13 105.3 12 13 14 15 15 15.5 16 16 69 19.79 13.5 14 15 16 16 16 16 16 255 5.35 14 15 16 16 16 16 16 16 ty pical rms resolution vs. input range and update rate: rms resolution in bits * sf data update input range w ord rate (hz) 20 mv 40 mv 80 mv 160 mv 320 mv 640 mv 1.28 v 2.56 v 13 105.3 14.7 15.7 16 16 16 16 16 16 69 19.79 16 16 16 16 16 16 16 16 255 5.35 16 16 16 16 16 16 16 16 * based on a six-sigma limit, the rms resolution is 2.7 bits greater than the peak-to-peak resolution. ta b le xii. auxiliary adc t ypical output rms noise vs. update rate * output rms noise in v sf data update input range w ord r a te (hz) 2.5 v 13 105.3 10.75 69 19.79 2.00 255 5.35 1.15 * adc converting in bipolar mode pe ak-to-peak resolution vs. update rate 1 p eak-to-peak res o lu tion in bits sf data update input range w ord rate (hz) 2.5 v 13 105.3 16 2 69 19.79 16 255 5.35 16 notes 1 adc converting in bipolar mode 2 in unipolar mode, peak-to-peak resolution at 105 hz is 15 bits. rev. 0
ADUC836 ?23? primary and auxiliary adc circuit description overview the ADUC836 incorporates two independent - adcs (primary and auxiliary) with on-chip digital ltering intended for the mea- surement of wide dynamic range, low fre quen cy signals such as those in weigh-scale, strain gage, pres sure transducer, or tempera- ture measurement applications. primary adc this adc is intended to convert the primary sensor input. the input is buffered and can be programmed for one of eight input ranges from ?0 mv to ?.56 v being driven from one of three differential input channel options ain1/2, ain3/4, or ain3/2. the input channel is internally buffered, allowing the part to handle signi cant source impedances on the analog input and allowing r/c ltering (for noise rejection or rfi reduction) to be placed on the analog inputs if required. on-chip burnout cur rents can also be turned on. these currents can be used to check that a transducer on the selected channel is still op er a tion al before a ttempting to take measurements. the adc employs a - conversion technique to realize up to 16 bits of no missing codes performance. the - modulator converts the sampled input signal into a digital pulse train whose duty cycle contains the digital information. a sinc 3 programmable low-pass lter is then employed to decimate the modulator output data stream to give a valid data conversion result at programmable output rates from 5.35 hz (186.77 ms) to 105.03 hz (9.52 ms). a chopping scheme is also employed to minimize adc offset errors. a block diagram of the primary adc is shown in figure 7. - modulator programmable digital filter - adc buffer agnd av dd refin(? refin(+) chop ain1 ain2 ain3 ain4 output average output scaling digtal output result written to adc0h/m/l sfrs pga chop output average as part of the chopping implementation, each data-word output from the filter is summed and averaged with its predecessor to null adc channel offset errors. - adc the - architecture ensures 24 bits no missing codes. the entire - adc is chopped to remove drift error. differential reference the external reference input to the ADUC836 is differential and facilitates ratiometric operation. the external reference voltage is selected via the xref0 bit in adc0con. reference detect circuitry tests for open or shorted reference inputs. analog input chopping the inputs are alternately reversed through the conversion cycle. chopping yields excellent adc offset and offset drift performance. burnout currents two 100na burnout currents allow the user to easily detect if a transducer has burned out or gone open-circuit. analog multiplexer a differential multiplexer allows selection of three fully differential pair options and additional internal short option (a in2?in2). the multiplexer is controlled via the channel selection bits in adc0con. buffer amplifier the buffer amplifier presents a high impedance input stage for the analog inputs, allowing significant external source impedances. the modulator provides a high frequency 1-bit data stream (the output of which is also chopped) to the digital filter, the duty cycle of which represents the sampled analog input voltage. - modulator programmable digital filter the sinc 3 filter removes quantization noise introduced by the modulator. the update rate and bandwidth of this filter are programmable via the sf sfr. the ouput word from the digital filter is scaled by the calibration coefficients before being provided as the conversion result. output scaling programmable gain amplifier the programmable gain amplifier allows eight unipolar and eight bipolar input ranges from 20mv to 2.56v (ext v ref = 2.5v). mux figure 7. primary adc block diagram rev. 0
ADUC836 ?24? the auxiliary adc has three external input pins (labeled ain3 to ain5) as well as an internal connection to the on-chip tem- perature sensor. all inputs to the auxiliary adc are single-ended inputs referenced to the agnd on the part. chan nel selection bits in the adc1con sfr detailed in table vii allow selection of one of four inputs. tw o input multiplexers switch the selected input channel to the on-chip buffer ampli er in the case of the primary adc and directly to the - modulator input in the case of the auxiliary adc. when the analog input channel is switched, the settling time of the part must elapse before a new valid word is available from the adc. mu x ain3 ain4 ain5 on-chip temperature sensor - modulator programmable digital filter - adc refin(? refin(+) chop output average output scaling digtal output result written to adc1h/l sfrs chop - adc the - architecture ensures 16 bits no missing codes. the entire - adc is chopped to remove drift errors. mux output average as part of the chopping implementation, each data-word output from the filter is summed and averaged with its predecessor to null adc channel offset errors. the modulator provides a high frequency 1-bit data stream (the output of which is also chopped) to the digital filter, the duty cycle of which represents the sampled analog input voltage. - modulator programmable digital filter the sinc 3 filter removes quantization noise introduced by the modulator. the update rate and bandwidth of this filter are programmable via the sf sfr. the ouput word from the digital filter is scaled by the calibration coefficients before being provided as the conversion result. output scaling analog input chopping the inputs are alternately reversed through the conversion cycle. chopping yields excellent adc offset and offset drift performance. differential reference the external reference input to the ADUC836 is differential and facilitates ratiometric operation. the external reference voltage is selected via the xref1 bit in adc1con. reference detect circuitry tests for open or shorted reference inputs. analog multiplexer a differential multiplexer allows selection of three external single ended inputs or the on-chip temp. sensor. the multiplexer is controlled via the channel selection bits in adc1con. figure 8. auxiliary adc block diagram auxiliary adc the auxiliary adc is intended to convert supplementary inputs such as those from a cold junction diode or thermistor. this adc is not buffered and has a xe d input range of 0 v to 2.5 v (as sum ing an external 2.5 v reference). the single-ended inputs can be driven from ain3, ain4, or ain5 pins, or directly from the on-chip temperature sensor voltage. a block diagram of the aux il ia ry adc is shown in figure 8. analog input channels the primary adc has four associated analog input pins (labeled ain1 to ain4) that can be con gured as two fully dif fer en tial input channels. channel selection bits in the adc0con sfr detailed in table vi allow three combinations of differential pair selection as well as an additional shorted input option (ain2?in2). rev. 0
ADUC836 ?25? primary and auxiliary adc inputs the output of the primary adc multiplexer feeds into a high impedance input stage of the buffer ampli er. as a result, the primary adc inputs can handle signi cant source im ped anc es and are tailored for direct connection to external re sis tive-type sen- sors like strain gages or resistance tem per a ture detectors (rtds). the auxiliary adc, however, is unbuffered, resulting in higher analog input current on the auxiliary adc. it should be noted that this unbuffered input path provides a dynamic load to the driving source. therefore, resistor/capacitor combinations on the input pins can cause dc gain errors depending on the output impedance of the source that is driving the adc inputs. analog input ranges the absolute input voltage range on the primary adc is restricted to between agnd + 100 mv to av dd ?100 mv. care must be taken in setting up the common-mode voltage and input voltage range so that these limits are not exceeded; oth er wise there will be a degradation in linearity performance. the absolute input voltage range on the auxiliary adc is restricted to between agnd ?30 mv to av dd + 30 mv. the slightly negative absolute input voltage limit does allow the possibility of monitor- ing small signal bipolar signals using the single-ended auxiliary adc front end. programmable gain ampli er the output from the buffer on the primary adc is applied to the input of the on-chip programmable gain ampli er (pga). the pga can be programmed through eight different unipolar input ranges and bipolar ranges. the pga gain range is pro g rammed via the range bits in the adc0con sfr. with the external reference select bit set in the adc0con sfr and an external 2.5 v reference, the unipolar ranges are 0 mv to 20 mv, 0 mv to 40 mv, 0 mv to 80 mv, 0 mv to 160 mv, 0 mv to 320 mv, 0 mv to 640 mv, 0 v to 1.28 v, and 0 to 2.56 v; the bipolar ranges are ?0 mv, ?0 mv, ?0 mv, ?60 mv, ?20 mv, ?40 mv, ?.28 v, and ?.56 v. these are the nom i nal ranges that should appear at the input to the on-chip pga. an adc range matching speci cation of 2 ? (typ) across all ranges means that calibration need only be car ri ed out at a single gain range and does not have to be repeated when the pga gain range is changed. t ypical matching across ranges is shown in figure 9. here, the primary adc is con gured in bipolar mode with an external 2.5 v reference, while just greater than 19 mv is forced on its in puts. the adc continuously converts the dc input voltage at an update rate of 5.35 hz, i.e., sf = ffh. in total, 800 con ver sion results are gathered. the r st 100 results are gathered with the primary adc operating in the ?0 mv range. the adc range is then switched to ?0 mv, 100 more con ver sion results are gathered, and so on, until the last group of 100 sam ples is gathered with the adc con- gured in the ?.56 v range. from figure 9, the variation in the sample mean through each range, i.e., the range matching, is seen to be of the order of 2 v. the auxiliary adc does not incorporate a pga and is con g ured for a x ed single input range of 0 to v ref . 0 100 200 300 400 500 600 700 800 sample count adc input voltage ?mv 19.372 19.371 19.370 19.369 19.368 19.367 19.366 19.365 19.364 adc range 20mv 40mv 80mv 320mv 2.56v 160mv 640mv 1.28v figure 9. primary adc range matching bipolar/unipolar inputs the analog inputs on the ADUC836 can accept either unipolar or bipolar input voltage ranges. bipolar input ranges do not imply that the part can handle negative voltages with respect to system a gnd. unipolar and bipolar signals on the ain(+) input on the pri ma ry adc are referenced to the voltage on the respective ain(? input. for example, if ain(? is 2.5 v and the primary adc is con gured for an analog input range of 0 mv to 20 mv, the input v oltage range on the ain(+) input is 2.5 v to 2.52 v. if ain(? is 2.5 v and the ADUC836 is con gured for an analog input range of 1.28 v, the analog input range on the ain(+) input is 1.22 v to 3.78 v (i.e., 2.5 v ?1.28 v). as mentioned earlier, the auxiliary adc input is a single-ended input with respect to the system agnd. in this context, a bi po lar signal on the auxiliary adc can only span 30 mv negative with respect to agnd before violating the voltage input limits for this adc. bipolar or unipolar options are chosen by programming the pri- mary and auxiliary unipolar enable bits in the adc0con and adc1con sfrs, respectively. this programs the relevant adc for either unipolar or bipolar operation. programming for either unipolar or bipolar operation does not change any of the input signal conditioning; it simply changes the data output coding and the points on the transfer function where cal i bra tions occur. when an adc is con gured for unipolar operation, the output coding is natural (straight) binary with a zero dif fer en tial input v oltage resulting in a code of 000 . . . 000, a midscale voltage resulting in a code of 100 . . . 000, and a full-scale input voltage resulting in a code of 111 . . . 111. when an adc is con gured for bipolar operation, the coding is offset binary with a negative full-scale voltage resulting in a code of 000 . . . 000, a zero dif- ferential voltage resulting in a code of 100 . . . 000, and a positive full-scale voltage resulting in a code of 111 . . . 111. rev. 0
ADUC836 ?26? reference input the ADUC836s reference inputs, refin(+) and refin(?, provide a differential reference input capability. the common- mode range for these differential inputs is from agnd to av dd . the nominal reference voltage, v ref (refin(+) ?refin(?), for speci ed operation is 2.5 v with the primary and auxiliary reference enable bits set in the respective adc0con and/or adc1con sfrs. the part is also functional (although not speci ed for per for - mance) when the xref0 or xref1 bits are 0, which enables the on-chip internal band gap reference. in this mode, the adcs will see the internal reference of 1.25 v, therefore halving all input ranges. as a result of using the internal reference voltage, a noticeable degradation in peak-to-peak resolution will result. therefore, for best performance, operation with an external reference is strongly rec om mend ed. in applications where the excitation (voltage or current) for the transducer on the analog input also drives the reference voltage for the part, the effect of the low frequency noise in the ex ci ta tion source will be removed as the application is ratiometric. if the ADUC836 is not used in a ratiometric application, a low noise reference should be used. rec om mend ed reference volt age sources for the ADUC836 include the ad780, ref43, and ref192. it should also be noted that the reference inputs provide a high impedance, dynamic load. because the input impedance of each reference input is dynamic, resistor/capacitor combinations on these inputs can cause dc gain errors depending on the output imped- ance of the source that is driving the reference inputs. reference v oltage sources, like those recommended above (e.g., ad780), will typically have low output impedances and there fore decoupling capacitors on the refin(+) input would be recommended. deriving the reference input voltage across an external resistor, as shown in figure 66, will mean that the reference input sees a signi cant external source impedance. external decoupling on the refin(+) and refin(? pins would not be recommended in this type of circuit con guration. burnout currents the primary adc on the ADUC836 contains two 100 na con- stant current generators: one sourcing current from av dd to ain(+) and one sinking from ain(? to agnd. the currents are switched to the selected analog input pair. both currents are either on or off, depending on the burnout current enable (bo) bit in the icon sfr (see table ix). these currents can be used to verify that an external transducer is still operational before attempting to take measurements on that channel. once the burnout currents are turned on, they will ow in the ex ter nal transducer circuit, and a measurement of the input voltage on the analog input channel can be taken. if the resultant volt age measured is full-scale, it indicates that the transducer has gone open-circuit. if the voltage measured is 0 v, it indicates that the transducer has short circuited. for normal operation, these burn- out currents are turned off by writing a 0 to the bo bit in the icon sfr. the current sources work over the nor mal absolute input voltage range speci cations. excitation currents the ADUC836 also contains two identical, 200 ? constant current sources. both source current from av dd to pin 3 (iexc1) or pin 4 (iexc2). these current sources are con trolled via bits in the icon sfr shown in table ix. they can be con gured to source 200 ? individually to both pins or a combination of both currents, i.e., 400 ?, to either of the selected pins. these current sources can be used to excite ex ter nal resistive bridge or rtd sensors. reference detect the ADUC836 includes on-chip circuitry to detect if the part has a valid reference for conversions or calibrations. if the volt age between the external refin(+) and refin(? pins goes below 0.3 v or either the refin(+) or refin(? inputs is open circuit, the ADUC836 detects that it no longer has a valid reference. in this case, the noxref bit of the adcstat sfr is set to a 1. if the ADUC836 is performing normal con ver sions and the noxref bit becomes active, the con ver sion results revert to all 1s. it is not necessary to continuously mon i tor the status of the noxref bit when performing con ver sions. it is only necessary to verify its status if the con ver sion result read from the adc data register is all 1s. if the ADUC836 is performing either an offset or gain cal i bra tion and the noxref bit becomes active, the updating of the respec- tive calibration registers is inhibited to avoid loading incorrect coef cients to these registers, and the appropriate err0 or err1 bits in the adcstat sfr are set. if the user is concerned about ve r ifying that a valid reference is in place every time a calibration is performed, the status of the err0 or err1 bit should be checked at the end of the calibration cycle. - modulator a - adc generally consists of two main blocks, an analog modu- lator and a digital lter. in the case of the ADUC836 adcs, the analog modulators consist of a difference ampli er, an integrator block, a comparator, and a feedback dac, as illustrated in figure 10. dac integrator analog input difference amp comparator high frequency bit stream to digital filter figure 10. - modulator simpli ed block di a gram in operation, the analog signal sample is fed to the difference ampli er along with the output of the feedback dac. the dif- ference between these two signals is integrated and fed to the comparator. the output of the comparator provides the input to the feedback dac so the system functions as a negative feed back loop that tries to minimize the difference signal. the dig i tal data that represents the analog input voltage is contained in the duty c ycle of the pulse train appearing at the output of the comparator. this duty cycle data can be reco v ered as a data-w ord using a sub- sequent digital lter stage. the sampling fre quen cy of the modulator loop is many times higher than the bandwidth of the input signal. the integrator in the modulator shapes the quantization noise (which results from the analog-to-digital conversion) so that the noise is pushed toward one-half of the modulator frequency. rev. 0
ADUC836 ?27? digital filter the output of the - modulator feeds directly into the digital lter. the digital lter then band-limits the response to a frequency signi cantly lower than one-half of the modulator frequency. in this manner, the 1-bit output of the comparator is translated into a band-limited, low noise output from the ADUC836 adcs. the ADUC836 lter is a low-pass, sin 3 or (sinx/x)3 lter whose primary function is to remove the quantization noise introduced at the modulator. the cutoff frequency and dec i mat ed output data rate of the lter are programmable via the sf (sinc filter) sfr, as described in table viii. figure 11 shows the frequency response of the adc channel at the default sf word of 69 dec or 45h, yielding an overall output update rate of just under 20 hz. it should be noted that this frequency response allows fre quen cy components higher than the adc nyquist frequency to pass through the adc, in some cases without signi cant at ten u a tion. these components may, therefore, be aliased and appear in-band after the sampling process. it should also be noted that rejection of mains related frequency components, i.e., 50 hz and 60 hz, is seen to be at a level of >65 db at 50 hz and >100 db at 60 hz. this con rm s the data sheet speci cations for 50 hz/60 hz normal mode rejection (nmr) at a 20 hz update rate. 0203050708 090 100 110 frequency ?hz gain ?db 0 ?0 ?0 ?0 ?0 ?0 ?00 ?10 ?20 10 40 60 ?0 ?0 ?0 ?0 figure 11. filter response, sf = 69 dec the response of the lter, however, will change with sf word, as can be seen in figure 12, which shows >90 db nmr at 50 hz and >70 db nmr at 60 hz when sf = 255 dec. 02030507 080 9 0 110 frequency ?hz gain ?db 0 ?0 ?0 ?0 ?0 ?0 ?00 ?10 ?20 10 40 60 ?0 ?0 ?0 ?0 figure 12. filter response, sf = 255 dec figures 13 and 14 show the nmr for 50 hz and 60 hz across the full range of sf word, i.e., sf = 13 dec to sf = 255 dec. 10 50 70 110 150 170 190 210 sf ?decimal gain ?db 0 ?0 ?0 ?0 ?0 ?0 ?00 ?10 ?20 30 90 130 ?0 ?0 ?0 ?0 230 250 figure 13. 50 hz normal mode rejection vs. sf 10 50 70 110 150 170 190 210 sf ?decimal gain ?db 0 ?0 ?0 ?0 ?0 ?0 ?00 ?10 ?20 30 90 130 ?0 ?0 ?0 ?0 230 250 figure 14. 60 hz normal mode rejection vs. sf rev. 0
ADUC836 ?28? adc chopping both adcs on the ADUC836 implement a chopping scheme whereby the adc repeatedly reverses its inputs. the decimated digital output words from the sinc 3 lters therefore have a positive offset and negative offset term included. as a result, a nal summing stage is included in each adc so that each output word from the lter is summed and averaged with the previous lter output to produce a new valid output result to be written to the adc data sfrs. in this way, while the adc throughput or update rate is as discussed earlier and illustrated in t able viii, the full settling time through the adc (or the time to a r st conversion result) will actually be given by 2 t adc . the chopping scheme incorporated in the ADUC836 adc results in excellent dc offset and offset drift speci cations and is extremely bene cial in applications where drift, noise rejection, and optimum emi rejection are important factors. calibration the ADUC836 provides four calibration modes that can be pro- g rammed via the mode bits in the adcmode sfr detailed in t able v. in fact, every ADUC836 has already been factory cali- brated. the resultant offset and gain calibration co ef cients for both the primary and auxiliary adcs are stored on-chip in manufacturing-speci c flash/ee memory locations. at power-on or after reset, these factory calibration coef cients are automati- cally downloaded to the cal i bra tion registers in the ADUC836 sfr space. each adc (primary and auxiliary) has dedicated calibration sfrs, which have been described earlier as part of the general adc sfr description. however, the factory calibration v alues in the adc calibration sfrs will be over writ ten if any one of the four calibration options are initiated and that adc is enabled via the adc enable bits in adcmode. even though an internal offset calibration mode is described below, it should be recognized that both adcs are chopped. this chopping scheme inherently minimizes offset and means that an internal offset calibration should never be required. also, because f actory 5 v/25? gain calibration coef cients are au to mat i cal ly present at power-on an internal full-scale cal i bra tion will only be required if the part is being operated at 3 v or at temperatures signi cantly different from 25?. the ADUC836 offers internal or system calibration fa cil i ties. for full cal i bra tion to occur on the selected adc, the calibration logic must record the modulator output for two different input conditions: zero-scale and full-scale points. these points are derived by performing a con ver sion on the different input volt- ages provided to the input of the modulator during calibration. the result of the zero-scale calibration conversion is stored in the offset calibration registers for the appropriate adc. the result of the full-scale calibration conversion is stored in the gain cali- bration reg is ters for the appropriate adc. with these readings, the cal i bra tion logic can calculate the offset and the gain slope for the input-to-output transfer function of the converter. during an internal zero-scale or full-scale calibration, the respec tive zero-scale input and full-scale inputs are automatically connected to the adc input pins internally to the device. a system calibration, however, expects the system zero-scale and system full-scale volt- ages to be applied to the external adc pins before the calibration mode is initiated. in this way, ex ter nal adc errors are taken into account and minimized as a result of system calibration. it should also be noted that to op ti mize calibration accuracy, all ADUC836 adc calibrations are carried out automatically at the slowest update rate. internally in the ADUC836, the coef cients are normalized before being used to scale the words coming out of the digital lter. the offset calibration coef cient is subtracted from the result prior to the multiplication by the gain coef cient. from an operational point of view, a calibration should be treat ed like another adc conversion. a zero-scale calibration (if required) should always be carried out before a full-scale cal i bra tion. system software should monitor the relevant adc rdy0/1 bit in the adcstat sfr to determine end of cal i bra tion via a polling sequence or interrupt driven routine. rev. 0
ADUC836 ?29? ADUC836 flash/ee memory reliability the flash/ee program and data memory arrays on the ADUC836 are fully quali ed for two key flash/ee memory characteristics: flash/ee memory cycling endurance and flash/ee memory data retention. endurance quanti es the ability of the flash/ee memory to be c ycled through many program, read, and erase cycles. in real terms, a single endurance cycle is composed of four in de pen dent, sequential events, which are de ned as: a. initial page erase sequence b. read/verify sequence c. byte program sequence d. second read/verify sequence in reliability quali cation, every byte in both the program and data flash/ee memory is cycled from 00h to ffh until a rst fa il is recorded, signifying the endurance limit of the on-chip flash/ee memory. as indicated in the speci cation tables, the ADUC836 flash/ee memory endurance qualification has been carried out in ac cordance with jedec speci cation a117 over the industrial temperature range of ?0?, +25?, +85?, and +125?. the results allow the speci cation of a minimum endurance gure ov er supply and temperature of 100,000 cy cles, with an endur- ance gure of 700,000 cycles being typical of operation at 25?. retention quanti es the ability of the flash/ee memory to retain its programmed data over time. again, the ADUC836 has been quali ed in accordance with the formal jedec retention life- time speci cation (a117) at a speci c junction temperature (t j = 55?). as part of this quali cation procedure, the flash/ee memory is cycled to its speci ed endurance limit described above, before data retention is characterized. this means that the flash/ee memory is guaranteed to retain its data for its full speci ed reten- tion lifetime every time the flash/ee memory is reprogrammed. it should also be noted that retention lifetime, based on an activa- tion energy of 0.6 ev, will derate with t j , as shown in figure 16. 40 60 70 90 t j junction temperature ?  c retention ?years 250 200 150 100 50 0 50 80 110 300 100 adi specification 100 years min. at t j = 55  c figure 16. flash/ee memory data retention nonvolatile flash/ee memory flash/ee memory overview the ADUC836 incorporates flash/ee memory technology on-chip to provide the user with nonvolatile, in-circuit, repro- g rammable code and data memory space. flash/ee mem o ry is a relatively recent type of nonvolatile mem o ry tech nol o gy and is based on a single transistor cell ar chi tec ture. this technology is basically an outgrowth of eprom tech nol o gy and was devel- oped through the late 1980s. flash/ee mem o ry takes the exible in-circuit reprogrammable features of eeprom and combines them with the space ef cient/density features of eprom (see figure 15). because flash/ee technology is based on a single transistor cell architecture, a flash memory array, like eprom, can be im- ple ment ed to achieve the space ef cien cies or memory densities required by a given design. like eeprom, ash memory can be programmed in-system at a byte level, although it must r st be erased; the erase being performed in page blocks. thus, ash memory is often and more correctly referred to as flash/ee memory. flash/ee memory technology space efficient/ density in-circuit reprogrammable eprom technology eeprom technology figure 15. flash/ee memory development overall, flash/ee memory represents a step closer to the ideal memory device that includes nonvolatility, in-circuit pro gramma - bil i ty, high density, and low cost. incorporated into the ADUC836, flash/ee memory technology allows the user to update program code space in-circuit, without the need to replace one-time pro- g rammable (otp) devices at remote operating nodes. flash/ee memory and the ADUC836 the ADUC836 provides two arrays of flash/ee memory for user applications. 62 kbytes of flash/ee program space are provided on-chip to facilitate code execution without any ex ter nal dis- crete rom device requirements. the program memory can be pro g rammed in-circuit, using the serial download mode provided, using conventional third party memory programmers, or via any user de ned protocol in user download (uload) mode. a 4 kbyte flash/ee data memory space is also provided on-chip. this may be used as a general-purpose, nonvolatile scratch pad area. user access to this area is via a group of seven sfrs. this space can be programmed at a byte level, although it must r st be erased in 4-byte pages. a single flash/ee memory endurance cycle rev. 0
ADUC836 ?30? flash/ee program memory the ADUC836 contains a 64 kbyte array of flash/ee program memory. the lower 62 kbytes of this program memory are avail- able to the user, and can be used for program storage or indeed as additional nv data memory. the upper 2 kbytes of this flash/ee program memory array con- tain per manently embedded rm w are, allowing in-circuit serial down load, serial debug, and nonintrusive single pin em u la tion. these 2 kbytes of embedded rm w are also contain a pow er-on con guration routine that downloads factory cal i brat ed co ef - cients to the various calibrated peripherals (adc, tem per a ture sensor, current sources, band gap references, and so on). this 2 kbyte embedded rm w are is hidden from user code. attempts to read this space will read 0s, i.e., the embedded rm- w are appears as nop instructions to user code. in normal operating mode (power-up default), the 62 kbytes of user flash/ee program memory appear as a single block. this block is used to store the user code, as shown in figure 17. ffffh 0000h f800h f7ffh user program memory 62 kbytes of flash/ee program memory is available to the user. all of this space can be programmed from the permanently embedded download/debug kernel or in parallel programming mode. embedded download/debug kernel permanently embedded firmware allows code to be downloaded to any of the 62 kbytes of on-chip program memory. the kernel program appears as ?op?instructions to user code. 62 kbyte 2 kbyte figure 17. flash/ee program memory map in normal mode in normal mode, the 62 kbytes of flash/ee program memory can be programmed by serial downloading or parallel processing: (1) serial downloading (in-circuit programming) the ADUC836 facilitates code download via the standard uart serial port. the ADUC836 will enter serial download mode after a reset or power cycle if the psen pin is pulled low through an external 1 k resistor. once in serial download mode, the hidden embedded download kernel will execute. this allows the user to download code to the full 62 kbytes of flash/ee program memo- ry while the device is in circuit in its target ap pli ca tion hardware. a pc serial download executable is provided as part of the ADUC836 quickstart development system. application note uc004 fully describes the serial download protocol that is used by the embedded download kernel. this a pplication note is av ailable at www.analog.com/microconverter. (2) parallel programming the parallel programming mode is fully compatible with con- ven tion al third party flash or eeprom device programmers. a block diagram of the external pin con guration required to support parallel programming is shown in figure 18. in this mode, po r ts 0 and 2 operate as the external address bus in ter f ace, p3 operates as the external data bus interface, and p1.0 operates as the write enable strobe. port 1.1, p1.2, p1.3, and p1.4 are used as a general con guration port that con gures the device for vari- ous program and erase operations during parallel programming. ta b le xiii. flash/ee memory parallel programming modes port 1 pins p1.4 p1.3 p1.2 p1.1 programming mode 0 0 0 0 erase flash/ee program, data, and se cu ri ty modes 1 0 0 1 read device signature/id 1 0 1 0 program code byte 0 0 1 0 program data byte 1 0 1 1 read code byte 0 0 1 1 read data byte 1 1 0 0 program security modes 1 1 0 1 read/verify security modes all other codes redundant v dd gnd p1.1 -> p1.4 psen reset p3 p0 p2 ADUC836 5v program mode (see table xiii) gnd program data ( d0?7) program address ( a0?13) (p 2.0 = a0) (p 1.7 = a13) command enable p1.0 ea entry sequence v dd gnd p1.5 -> p1.7 timing figure 18. flash/ee memory parallel programming rev. 0
ADUC836 ?31? user download mode (uload) in figure 17 we can see that it was possible to use the 62 kbytes of flash/ee program memory available to the user as one single block of memory. in this mode, all of the flash/ee memory is read only to user code. however, the flash/ee program memory can also be written to during runtime simply by entering uload mode. in uload mode, the lower 56 kbytes of program memory can be erased and reprogrammed by user software, as shown in figure 19. uload mode can be used to upgrade your code in the eld via any user de ned download protocol. con guring the spi port on the ADUC836 as a slave, it is possible to completely re pro g ram the 56 kbytes of flash/ee program memory in only 5 seconds (see application note uc007). alternatively, uload mode can be used to save data to the 56 kbytes of flash/ee memory. this can be extremely useful in data logging applications where the ADUC836 can provide up to 60 kbytes of nv data memory on-chip (4 kbytes of dedicated flash/ee data memory also exist). the upper 6 kbytes of the 62 kbytes of flash/ee program mem o ry are only pro g ram ma ble via serial download or parallel pro g ram - ming. this means that this space appears as read-only to user code. therefore, it cannot be accidently erased or re pro g rammed by erroneous code execution. this makes it very suit able to use the 6 kbytes as a bootloader. a bootload en able op tion exists in the serial downloader to ?lways run from e000h after reset. if using a bootloader, this option is rec om mend ed to ensure that the bootloader always executes correct code after reset. programming the flash/ee program memory via uload mode is described in more detail in the description of econ and also in application note uc007. ffffh e000h dfffh 0000h user bootloader space the user bootloader space can be programmed in download/debug mode via the kernel but is read only when executing user code 6 kbyte f800h f7ffh user download space either the download/debug kernel or user code (in uload mode) can program this space. embedded download/debug kernel permanently embedded firmware allows code to be downloaded to any of the 62 kbytes of on-chip program memory. the kernel program appears as ?op?instructions to user code. 56 kbyte 2 kbyte 62 kbytes of user code memory figure 19. flash/ee program memory map in uload mode flash/ee program memory security the ADUC836 facilitates three modes of flash/ee program memory security. these modes can be independently ac ti vat ed, restrict- ing access to the internal code space. these security modes can be enabled as part of serial download protocol, as described in application note uc004, or via parallel pro g ram ming. the ADUC836 offers the following security modes: lock mode this mode locks the code memory, disabling parallel pro g ram - ming of the program memory. however, reading the memory in p arallel mode and reading the memory via a movc com mand from external memory is still allowed. this mode is de ac ti vat ed by initiating an ?rase code and data command in serial down- load or parallel programming modes. secure mode this mode locks the code memory, disabling parallel pro g ram - ming of the program memory. reading/verifying the memory in parallel mode and reading the internal memory via a movc command from external memory is also disabled. this mode is deactivated by initiating an ?rase code and data command in serial download or parallel programming modes. serial safe mode this mode disables serial download capability on the device. if serial safe mode is activated and an attempt is made to reset the part into serial download mode, i.e., reset asserted and deasserted with psen low, the part will interpret the serial down- load reset as a normal reset only. it will therefore not enter serial download mode, but only execute a normal reset sequence. serial safe mode can only be disabled by initiating an ?rase code and data command in parallel programming mode. rev. 0
ADUC836 ?32? using the flash/ee data memory the 4 kbytes of flash/ee data memory are con gured as 1024 pag es, each of four bytes. as with the other ADUC836 pe r iph er als, the interface to this memory space is via a group of reg is ters mapped in the sfr space. a group of four data regis- ters (edata1?4) is used to hold the four bytes of data at each page. the page is addressed via the two registers eadrh and eadrl. finally, econ is an 8-bit control register that may be written with one of nine flash/ee mem o ry access commands to trigger various read, write, erase, and verify functions. a block diagram of the sfr interface to the flash/ee data mem o ry array is shown in figure 20. econ?lash/ee memory control sfr programming of either the flash/ee data memory or the flash/ee program memory is done through the flash/ee memory con trol sfr (econ). this sfr allows the user to read, write, erase, or ve r ify the 4 kbytes of flash/ee data mem o ry or the 56 kbytes of flash/ee program memory. b yte 1 (0000h) edata1 sfr b yte 1 (0004h) b yte 1 (0008h) b yte 1 ( 000ch) b yte 1 (0 ff8h) b yte 1 (0 ffch) b yte 2 (0001h) edata2 sfr b yte 2 (0005h) b yte 2 (0009h) b yte 2 ( 000dh) b yte 2 (0 ff9h) b yte 2 (0 ffdh) b yte 3 (0002h) edata3 sfr b yte 3 (0006h) b yte 3 (000ah) b yte 3 (000eh) b yte 3 (0 ffah) b yte 3 (0 ffeh) b yte 4 (0003h) edata4 sfr b yte 4 (0007h) b yte 4 ( 000bh) b yte 4 ( 000fh) b yte 4 (0 ffbh) b yte 4 (0 fffh) 01h 00h 02h 03h 3feh 3ffh page address (e adrh/l) b yte a ddresses are given in brackets figure 20. flash/ee data memory control and con g u ra tion ta b le xiv. econ?lash/ee memory commands command description command description econ value (normal mode) (power-on default) (uload mode) 01h results in four bytes in the flash/ee data mem o ry , not implemented. use the movc instruction. read addressed by the page address eadrh/l, being read into edata 1 to 4. 02h results in four bytes in edata1?4 being writ ten to the results in bytes 0?55 of internal xram being writ ten write flash/ee data memory, at the page address given by to the 256 bytes of flash/ee program memory at the eadrh/l (0 eadrh/l < 0400h) page address given by eadrh. (0 eadrh < e0h) note: the four bytes in the page being addressed must note: the 256 bytes in the page being addressed must be pre-erased. be pre-erase d. 03h reserved command reserved command 04h veri es if the data in edata1? is contained in the not implemented. use the movc and movx verify page address given by eadrh/l. a subsequent read instructions to verify the write in software. of the econ sfr will result in a 0 being read if the veri cation is valid, or a nonzero value being read to indicate an invalid ver i ca tion. 05h results in the erase of the 4-bytes page of flash/ee results in the 64-byte page of flash/ ee program erase page data memory addressed by the page address eadrh/l memory, addressed by the byte address eadrh/l bei ng erased. eadrl can equal any of 64 locations wit hin the page. a new page starts whenever eadrl is equal to 00h, 40h, 80h, or c0h. 06h results in the erase of entire four kbytes of flash/ee results in the erase of the entire 56 kbytes of uload erase all data memory. flash/ee program memory. 81h results in the byte in the flash/ee data memory, not implemented. use the movc command. readbyte addressed by the byte address eadrh/l, being read into edata1. (0 eadrh/l 0fffh). 82h results in the byte in edata1 being written into results in the byte in edata1 being wri tten into writebyte flash/ee data memory, at the byte address eadrh/l. flash/ee program memory at the byte address ead rh/l (0 eadrh/l dfffh). 0fh leaves the econ instructions to operate on the enters normal mode, directing subsequen t econ exuload flash/ee data memory. instructions to operate on the fl ash/ee data memory. f0h enters uload mode, directing subsequent econ leaves the econ instructions to operate on the flash/ee ulo ad instructions to operate on the flash/ee program memory. program memory. rev. 0
ADUC836 ?33? programming the flash/ee data memory a user wishes to program f3h into the second byte on page 03h of the flash/ee data memory space while preserving the other three bytes already in this page. a typical program of the flash/ee data array will involve: 1. setting eadrh/l with the page address 2. writing the data to be programmed to the edata1?4 3. writing the econ sfr with the appropriate command step 1: set up the page address the two address registers, eadrh and eadrl, hold the high byte address and the low byte address of the page to be addressed. the assembly language to set up the address may ap pear as: mov eadrh,#0 ; set page ad dress pointer mov eadrl,#03h step 2: set up the edata registers the four values to be written into the page into the four sfrs edata1?4. since we do not know three of them, it is necessary to read the current page and overwrite the second byte. mov econ,#1 ; read page into edata1-4 mov edata2,#0f3h ; overwrite byte 2 step 3: program page a byte in the flash/ee array can be programmed only if it has previously been erased. to be more speci? c, a byte can only be programmed if it already holds the value ffh. because of the flash/ee architecture, this erase must happen at a page level. therefore, a minimum of four bytes (1 page) will be erased when an erase command is initiated. once the page is erased, we can program the four bytes in-page and then perform a veri? cation of the data. mov econ,#5 ; erase page mov econ,#2 ; write page mov econ,#4 ; verify page mov a,econ ; check if econ=0 (ok!) jnz error note that although the four kbytes of flash/ee data memory is shipped from the factory pre-erased, i.e., byte locations set to ffh, it is nonetheless good programming practice to include an erase-all routine as part of any con? guration/setup code running on the ADUC836. an erase-all command consists of writing 06h to the econ sfr, which initiates an erase of the 4-kbyte flash/ee array. this command coded in 8051 as sem bly would appear as: mov econ,#06h ; erase all command ; 2 ms duration flash/ee memory timing t ypical program and erase times for the ADUC836 are as fol lows: normal mode (operating on flash/ee data memory) readpage (4 bytes) ? 5 machine cycles writepage (4 bytes) ? 380  s verifypage (4 bytes) ? 5 machine cycles erasepage (4 bytes) ? 2 ms eraseall (4 kbytes) ? 2 ms readbyte (1 byte) ? 3 machine cycles writebyte (1 byte) ? 200  s uload mode (operating on flash/ee program memory) writepage (256 bytes) ? 15 ms erasepage (64 bytes) ? 2 ms eraseall (56 kbytes) ? 2 ms writebyte (1 byte) ? 200  s it should be noted that a given mode of operation is initiated as soon as the command word is written to the econ sfr. the core microcontroller operation on the ADUC836 is idled until the requested program/read or erase mode is completed. in practice, this means that even though the flash/ee memory mode of operation is typically initiated with a two-machine c ycle mov instruction (to write to the econ sfr), the next in struc tion will not be executed until the flash/ee operation is com plete. this means that the core will not respond to interrupt requests until the flash/ee operation is complete, although the core peripheral functions like counter/timers will continue to count and time as con? gured throughout this period. rev. 0
ADUC836 ?34? programmed to appear at pin 3 or pin 12. it should be noted that in 12-bit mode, the dac volt age output will be updated as soon as the dacl data sfr has been writ ten; therefore, the da c data registers should be up dat ed as dach r st, followed by dacl. the 12-bit dac data should be written into dach/l ri ght-jus ti ed such that dacl con tains the lower eight bits, and the lower nibble of dach con tains the upper four bits. ta b le xv. daccon sfr bit designations bit name description 7 reserved for future use 6 reserved for future use 5 reserved for future use 4 dacpin dac output pin select. set by user to direct the dac output to pin 12 (p1.7/ain4/dac). cleared by user to direct the dac out put to pin 3 (p1.2/dac/iexc1). 3 dac8 dac 8-bit mode bit. set by user to enable 8-bit dac operation. in this mode, the 8 bits in dacl sfr are routed to the 8 msbs of the dac, and the 4 lsbs of the dac are set to zero. cleared by user to operate the dac in its normal 12-bit mode of operation. 2 dacrn dac output range bit. set by user to con gure dac range of 0 to av dd . cleared by user to con gure dac range of 0 v to 2.5 v (v ref ). 1 dacclr dac clear bit. set to 1 by user to enable normal dac operation. cleared to 0 by user to reset dac data registers dacl/h to zero. 0 dacen dac enable bit. set to 1 by user to enable normal dac operation. cleared to 0 by user to power down the dac. da ch/l dac data registers function dac data registers, written by user to update the dac output. sfr address dacl (dac data low byte) fbh dach (dac data high byte) fch po w er-on default value 00h both registers bit addressable no both registers using the d/a converter the on-chip d/a converter architecture consists of a resistor string dac followed by an output buffer ampli er, the func tion al equivalent of which is illustrated in figure 21. r r r r r ADUC836 av dd v ref output buffer dac 12 high-z disable (from mcu) figure 21. resistor string dac functional equivalent fe a tures of this architecture include inherent guaranteed mono to - nic i ty and excellent differential linearity. as illustrated in fig ure 21, the reference source for the dac is user selectable in software. it can be either av dd or v ref . in 0-to-av dd mode, the dac output transfer function spans from 0 v to the voltage at the av dd pin. in 0-to-v ref mode, the dac out put transfer function spans from 0 v to the internal v ref (2.5 v). the dac output buffer ampli er features a true rail-to-rail output stage im ple men ta tion. this means that, un load ed, each output is capable of swinging to within less than 100 mv of both av dd and ground. moreover, the dacs linear- ity spec i ca tion (when driving a 10 k resistive load to ground) is guar an teed through the full transfer function except codes 0 to 48 in 0-to-v ref mode and 0 to 100 and 3950 to 4095 in 0-to- v dd mode. linearity degradation near ground and v dd is caused by sat u ra tion of the output ampli er, and a general representation of its effects (neglecting offset and gain error) is illustrated in figure 22. the dotted line in figure 22 indicates the ideal transfer func tion, and the solid line represents what the transfer func tion might look like with endpoint nonlinearities due to saturation of the output ampli er. dac the ADUC836 incorporates a 12-bit voltage output dac on-chip. it has a rail-to-rail voltage output buffer capable of driving 10 k /100 pf. it has two selectable ranges, 0 v to v ref (the inter- nal band gap 2.5 v reference) and 0 v to av dd . it can operate in 12-bit or 8-bit mode. the dac has a control reg is ter, dac con, and two data registers, dach/l. the dac output can be rev. 0
ADUC836 ?35? v dd v dd ?0mv v dd ?00mv 100mv 50mv 0mv 000h fffh figure 22. endpoint nonlinearities due to am pli er saturation note that figure 22 represents a transfer function in 0-to-v dd mode only. in 0-to-v ref mode (with v ref < v dd ), the lower nonlinearity w ould be similar, but the upper por tion of the transfer function w ould follow the ?deal line right to the end, showing no signs of endpoint linearity errors. the endpoint nonlinearities conceptually illustrated in figure 22 get worse as a function of output loading. most of the ADUC836 data sheet speci cations assume a 10 k re sis tive load to ground at the dac output. as the output is forced to source or sink more current, the nonlinear regions at the top or bottom (respectively) of figure 22 become larger. with larger current demands, this can signi cantly limit output volt age swing. figures 23 and 24 illustrate this behavior. it should be noted that the upper trace in each of these g ures is valid only for an output range selection of 0-to-av dd . in 0-to-v ref mode, dac loading will not cause high side voltage drops as long as the reference voltage remains below the upper trace in the cor re spond ing gure. for example, if av dd = 3 v and v ref = 2.5 v, the high side voltage will not be affected by loads less than 5 ma. but somewhere around 7 ma, the upper curve in figure 24 drops below 2.5 v (v ref ), indicating that at these higher cur rents, the output will not be capable of reaching v ref . source/sink current ?ma 5 0510 15 output voltage ?v 4 3 2 1 0 dac loaded with 0000h dac loaded with 0fffh figure 23. source and sink current capability with v ref = av dd = 5 v source/sink current ?ma 4 0510 15 output voltage ?v 3 1 0 dac loaded with 0000h dac loaded with 0fffh figure 24. source and sink current capability with v ref = v dd = 3 v f or larger loads, the current drive capability may not be suf cient to increase the source and sink current ca pa bil i ty of the dac, an external buffer should be added, as shown in figure 25. ADUC836 12 figure 25. buffering the dac output the dac output buffer also features a high impedance disa ble func- tion. in the chips default powe r -on state, the da c is disabled and its output is in a high impedance state (or ?hree-state? where they remain inactive until enabled in soft w are. this means that if a zero output is desired during power-up or power-down transient conditions, a pull-down resistor must be added to each dac output. assuming this resistor is in place, the da c output will remain at ground potential when ev er the dac is disabled. rev. 0
ADUC836 ?36? pulsewidth modulator (pwm) the pwm on the ADUC836 is a highly exible pwm offering programmable resolution and input clock, and can be con g ured for any one of six different modes of operation. two of these modes allow the pwm to be con gured as a - dac with up to 16 bits of resolution. a block diagram of the pwm is shown in figure 26. clock select programmable divider compare 12.583mhz pwm clk 32.768khz 32.768khz/15 p1.0 p1.1 16-bit pwm counter figure 26. pwm block diagram ta b le xvi. pwmcon sfr bit designations bit name description 7 ? reserved for future use 6 md2 pwm mode bits 5 md1 the md2/1/0 bits choose the pwm mode as fol lows: 4 md0 md2 md1 md0 mode 0 0 0 mode 0: pwm disabled 0 0 1 mode 1: single variable resolution pwm 0 1 0 mode 2: twin 8-bit pwm 0 1 1 mode 3: twin 16-bit pwm 1 0 0 mode 4: dual nrz 16-bit - dac 1 0 1 mode 5: dual 8-bit pwm 1 1 0 mode 6: dual rz 16-bit - dac 1 1 1 reserved for future use 3 cdiv1 pwm clock divider. 2 cdiv0 scale the clock source for the pwm counter as follows: cdiv1 cdiv0 description 0 0 pwm counter = selected clock/1 0 1 pwm counter = selected clock 4 1 0 pwm counter = selected clock/16 1 1 pwm counter = selected clock/64 1 csel1 pwm clock divider. 0 csel0 select the clock source for the pwm as follows: csel1 csel0 description 0 0 pwm clock = f xtal /15 0 1 pwm clock = f xtal 1 0 pwm clock = external input at p3.4/t0/pwmclk 1 1 pwm clock = f vco (12.58 mhz) the pwm uses ve sfrs: the control sfr, pwmcon, and four data sfrs: pwm0h, pwm0l, pwm1h, and pwm1l. pwmcon (as described in table xvi) controls the different modes of operation of the pwm as well as the pwm clock fre- quency. pwm0h/l and pwm1h/l are the data registers that de ter mine the duty cycles of the pwm outputs at p1.0 and p1.1. to use the pwm user software, rs t write to pwmcon to select the pwm mode of operation and the pwm input clock. writing to pwmcon also resets the pwm counter. in any of the 16-bit modes of operation (modes 1, 3, 4, 6), user software should write to the pwm0l or pwm1l sfrs r st. this value is written to a hidden sfr. writing to the pwm0h or pwm1h sfrs updates both the pwmxh and the pwmxl sfrs but does not change the outputs until the end of the pwm cycle in progress. the va lues written to these 16-bit reg is ters are then used in the next pwm cycle. pwmcon pwm control sfr sfr address aeh po w er-on default value 00h bit addressable no rev. 0
ADUC836 ?37? pwm modes of operation mode 0: pwm disabled the pwm is disabled, allowing p1.0 and p1.1 to be used as nor mal. mode 1: single variable resolution pwm in mode 1, both the pulse length and the cycle time (period) are programmable in user code, allowing the resolution of the pwm to be variable. pwm1h/l sets the period of the output waveform. reducing pwm1h/l reduces the resolution of the pwm output but increases the maximum output rate of the pwm (e.g., setting pwm1h/l to 65536 gives a 16-bit pwm with a maximum output rate of 192 hz (12.583 mhz/65536). setting pwm1h/l to 4096 gives a 12-bit pwm with a max i mum output rate of 3072 hz (12.583 mhz/4096)). pwm0h/l sets the duty cycle of the pwm output waveform, as shown in figure 27. p1.0 pwm counter pwm1h/l 0 pwm0h/l figure 27. pwm in mode 1 mode 2: twin 8-bit pwm in mode 2, the duty cycle of the pwm outputs and the res o lu tion of the pwm outputs are both programmable. the max i mum resolution of the pwm output is eight bits. pwm1l sets the period for both pwm outputs. typically this will be set to 255 (ffh) to give an 8-bit pwm, although it is possible to reduce this as necessary. a value of 100 could be loaded here to give a percentage pwm (i.e., the pwm is ac cu rate to 1%). the outputs of the pwm at p1.0 and p1.1 are shown in figure 28. as can be seen, the output of pwm0 (p1.0) goes low when the pwm counter equals pwm0l. the output of pwm1 (p1.1) goes high when the pwm counter equals pwm1h and goes low again when the pwm counter equals pwm0h. setting pwm1h to 0 ensures that both pwm out puts start simultaneously. p1.1 p1.0 pwm counter pwm1h 0 pwm1l pwm0h pwm0l figure 28. pwm mode 2 mode 3: twin 16-bit pwm in mode 3, the pwm counter is x ed to count from 0 to 65536, g iving a x ed 16-bit pwm. operating from the 12.58 mhz core clock results in a pwm output rate of 192 hz. the duty cycle of the pwm outputs at p1.0 and p1.1 is in de pen dent ly pro g ram ma ble. as in figure 29, while the pwm counter is less than pwm0h/l, the output of pwm0 (p1.0) is high. once the pwm counter equals pwm0h/l, pwm0 (p1.0) goes low and remains low until the pwm counter rolls over. similarly, while the pwm counter is less than pwm1h/l, the output of pwm1 (p1.1) is high. once the pwm counter equals pwm1h/l, pwm1 (p1.1) goes low and remains low until the pwm counter rolls over. in this mode, both pwm outputs are synchronized (i.e., once the pwm counter rolls over to 0, both pwm0 (p1.0) and pwm1 (p1.1) will go high). p1.1 p1.0 pwm counter pwm1h/l 0 65536 pwm0h/l figure 29. pwm mode 3 rev. 0
ADUC836 ?38? mode 4: dual nrz 16-bit - dac mode 4 provides a high speed pwm output similar to that of a - da c. typically, this mode will be used with the pwm clock equal to 12.58 mhz. in this mode, p1.0 and p1.1 are updated every pwm clock (80 ns in the case of 12.58 mhz). over any 65536 cycles (16-bit pwm), pwm0 (p1.0) is high for pwm0h/l cycles and low for (65536 ?pwm0h/l) cycles. similarly, pwm1 (p1.1) is high for pwm1h/l cycles and low for (65536 ?pwm1h/l) cycles. if pwm1h is set to 4010h (slightly above one quarter of fs), then typically p1.1 will be low for three clocks and high for one clock (each clock is approximately 80 ns). over every 65536 clocks, the pwm will compromise for the fact that the output should be slightly above one quarter of full scale by having a high c ycle followed by only two low cycles. 12.583mhz 16-bit 80 s 80 s 0 16-bit 16-bit 16-bit 16-bit 16-bit carry out at p1.0 carry out at p1.1 pwm0h/l = c000h pwm1h/l = 4000h 00 1 000 latch 0 111 11 0 figure 30. pwm mode 4 f or faster dac outputs (at lower resolution), write 0s to the lsbs that are not required with a 1 in the lsb position. if, for ex am ple, only 12-bit per for mance is required, write 0001 to the 4 lsbs. this means that a 12-bit accurate - dac output can occur at 3 khz. similarly, writing 00000001 to the 8 lsbs gives an 8-bit ac cu rate - dac out put at 49 khz. mode 5: dual 8-bit pwm in mode 5, the duty cycle of the pwm outputs and the res o lu tion of the pwm outputs are individually programmable. the max- i mum resolution of the pwm output is 8 bits. the output resolution is set by the pwm1l and pwm1h sfrs for the p1.0 and p1.1 outputs, respectively. pwm0l and pwm0h set the duty cycles of the pwm outputs at p1.0 and p1.1, re spec tive ly. both pwms have the same clock source and clock divider. p1.1 p1.0 pwm counters pwm1h 0 pwm1l pwm0h pwm0l figure 31. pwm mode 5 mode 6: dual rz 16-bit - dac mode 6 provides a high speed pwm output similar to that of a - dac. mode 6 operates very similarly to mode 4. however, the key difference is that mode 6 provides return to zero (rz) - dac output. mode 4 provides non-return-to-zero - da c outputs. the rz mode ensures that any difference in the r ise and fall times will not affect the - dac inl. however, the rz mode halves the dynamic range of the - dac outputs from 0 av dd to 0 av dd /2. for best results, this mode should be used with a pwm clock divider of 4. if pwm1h is set to 4010h (slightly above one quarter of fs) then p1.1 will typically be low for three full clocks (3 80 ns), high for half a clock (40 ns) and then low again for half a clock (40 ns) before repeating itself. over every 65536 clocks, the pwm will compromise for the fact that the output should be slightly above one quarter of full scale by leaving the output high for two half clocks in four every so often. f or faster dac outputs (at lower resolution), write 0s to the lsbs that are not required with a 1 in the lsb position. if, for ex am ple, only 12-bit per for mance is required, write 0001 to the 4 lsbs. this means that a 12-bit accurate - dac output can occur at 3 khz. similarly, writing 00000001 to the 8 lsbs gives an 8-bit ac cu rate - dac out put at 49 khz. 3.146mhz 16-bit 318 s 0 16-bit 16-bit 16-bit 16-bit 16-bit carry out at p1.0 carry out at p1.1 pwm0h/l = c000h pwm1h/l = 4000h 00 1 000 latch 0 111 11 0 318 s figure 32. pwm mode 6 rev. 0
ADUC836 ?39? on-chip pll the ADUC836 is intended for use with a 32.768 khz watch crystal. a pll locks onto a multiple (384) of this to provide a stable 12.582912 mhz clock for the system. the core can op er a te at this frequency, or at binary submultiples of it, to allow power saving in cases where maximum core performance is not required. the default core clock is the pll clock divided by 8 or 1.572864 mhz. the adc clocks are also derived from the pll clock, with the mod u la tor rate being the same as the crys tal oscillator fre quen cy . this choice of frequencies ensures that the mod u la tors and the core will be synchronous, regardless of the core clock rate. the pll control register is pllcon. ta b le xvii. pllcon sfr bit designations bit name description 7 osc_pd oscillator power-down bit. set by user to halt the 32 khz oscillator in power-down mode. cleared by user to enable the 32 khz oscillator in power-down mode. this feature allows the tic to continue counting even in power-down mode. 6 lock pll lock bit. this is a read-only bit. set automatically at power-on to indicate the pll loop is correctly tracking the crystal clock. after power-down, this bit can be polled to wait for the pll to lock. cleared automatically at power-on to indicate the pll is not correctly track ing the crys tal clock. this may be due to the absence of a crystal clock or an ex ter nal crystal at pow er-on. in this mode, the pll output can be 12.58 mhz ?20%. after the ADUC836 wakes up from power-down, user code may poll this bit to wait for the pll to lock. if lock = 0, then the pll is not locked. 5 reserved for future use. should be written with 0. 4 ltea reading this bit returns the state of the external ea pin latched at reset or power-on. 3 fint fast interrupt response bit. set by user enabling the response to any interrupt to be executed at the fastest core clock frequency, regardless of the con guration of the cd2? bits (see below). after user code has returned from an interrupt, the core resumes code execution at the core clock selected by the cd2? bits. cleared by user to disable the fast interrupt response feature. 2 cd2 cpu (core clock) divider bits. 1 cd1 this number determines the frequency at which the microcontroller core will operate. 0 cd0 cd2 cd1 cd0 core clock frequency (mhz) 0 0 0 12.582912 0 0 1 6.291456 0 1 0 3.145728 0 1 1 1.572864 (default core clock fre quen cy) 1 0 0 0.786432 1 0 1 0.393216 1 1 0 0.196608 1 1 1 0.098304 pllcon pll control register sfr address d7h po w er-on default value 03h bit addressable no rev. 0
ADUC836 ?40? time interval counter (wake-up/rtc timer) a time interval counter (tic) is provided on-chip for: pe r iodically waking up the part from power-down im ple ment ing a real-time clock counting longer intervals than the standard 8051 compatible timers are capable of the tic is capable of timeout intervals ranging from 1/128th second to 255 hours. furthermore, this counter is clocked by the crystal oscillator rather than the by pll, and thus has the abil i ty to remain active in power-down mode and time long pow er-down intervals. this has obvious applications for remote battery-powered sensors where regular widely, spaced readings are required. the tic counter can easily be used to generate a real-time clock. the hardware will count in seconds, minutes, and hours; however, user software will have to count in days, months, and y ears. the current time can be written to the timebase sfrs (hthsec, sec, min, and hour) while tcen is low. when the rtc timer is enabled (tcen is set), the tcen bit itself and the hthsec, sec, min, and hour registers are not reset to 00h after a hardware or watchdog timer reset. this is to prevent the need to recalibrate the real-time clock after a reset. however, these registers will be reset to 00h after a power cycle (indepen- dent of tcen) or after any reset if tcen is clear. six sfrs are associated with the time interval counter, timecon being its control register. depending on the con g u ra tion of the it0 and it1 bits in timecon, the selected time counter register ov er ow will clock the interval counter. when this counter is equal to the time interval value loaded in the intval sfr, the tii bit (timecon.2) is set and gen er a tes an interrupt if enabled. (see ieip2 sfr description un der the interrupt system section.) if the ADUC836 is in pow er-down mode, again with tic inter- r upt enabled, the tii bit will wake up the device and resume code ex ecution by vec tor ing directly to the tic interrupt service v ector a ddress at 0053h. the tic-related sfrs are described in t able xviii with a block diagram of the tic shown in figure 33. 8-bit prescaler hundredths counter hthsec second counter sec minute counter min hour counter hour tien interval timeout time interval counter interrupt 8-bit interval counter intval sfr interval timebase selection mux tcen 32.768khz external crystal its0, 1 equal? figure 33. tic, simpli ed block diagram ta b le xviii. timecon sfr bit designations bit name description 7 ? reserved for future use 6 ? reserved for future use. for future product code compatibility, this bit should be written as a 1. 5 its1 interval timebase selection bits. 4 its0 written by user to determine the interval counter update rate. its1 its0 interval timebase 0 0 1/128 second 0 1 seconds 1 0 minutes 1 1 hours 3 sti single time interval bit. set by user to generate a single interval timeout. if set, a timeout will clear the tien bit. cleared by user to allow the interval counter to be automatically reloaded and start counting again at each interval timeout. 2 tii tic interrupt bit. set when the 8-bit interval counter matches the value in the intval sfr. cleared by user soft w are. 1 tien time interval enable bit. set by user to enable the 8-bit time interval counter. cleared by user to disable and clear the contents of the 8-bit interval counter. to ensure that the 8-bit interval counter is cleared, tien must be held low for at least 30.5 s (32 khz). 0 tcen time clock enable bit. set by user to enable the time clock to the time interval counters. cleared by user to disable the 32 khz clock to the tic and clear the 8-bit prescaler and the hthsec, sec, min, and hours sfrs. to ensure that these registers are cleared, tcen must be held low for at least 30.5 s (32 khz). the time registers (hthsec, sec, min, and hour) can be written only while tcen is low. rev. 0
ADUC836 ?41? intval user time interval select register function user code writes the re quired time interval to this register. when the 8-bit interval counter is equal to the time interval value loaded in the intval sfr, the tii bit (timecon.2) is set and generates an in ter r upt if enabled. (see ieip2 sfr description under the in ter r upt system section.) sfr address a6h po w er-on default value 00h reset default value 00h bit addressable no v alid value 0 to 255 decimal hthsec hundredths seconds time register function this register is incremented in 1/128 second intervals once tcen in timecon is ac tive. the hthsec sfr counts from 0 to 127 before rolling over to in cre ment the sec time register. sfr address a2h po w er-on default value 00h reset default value 00h if tcen = 0, previous value before reset if tcen = 1 bit addressable no v alid value 0 to 127 decimal sec seconds time register function this register is incremented in 1-second intervals once tcen in timecon is active . the sec sfr counts from 0 to 59 before rolling over to increment the min time reg is ter. sfr address a3h po w er-on default value 00h reset default value 00h if tcen = 0, previous value before reset if tcen = 1 bit addressable no v alid value 0 to 59 decimal min minutes time register function this register is incremented in 1-minute intervals once tcen in timecon is active . the min counts from 0 to 59 before rolling over to increment the hour time register. sfr address a4h po w er-on default value 00h reset default value 00h if tcen = 0, previous value before reset if tcen = 1 bit addressable no v alid value 0 to 59 decimal hour hours time register function this register is incremented in 1-hour intervals once tcen in timecon is active. the hour sfr counts from 0 to 23 before rolling over to 0. sfr address a5h po w er-on default value 00h reset default value 00h if tcen = 0, previous value before reset if tcen = 1 bit addressable no v alid value 0 to 23 decimal rev. 0
ADUC836 ?42? wa tchdog timer the purpose of the watchdog timer is to generate a device reset or interrupt within a reasonable amount of time if the ADUC836 enters an erroneous state, possibly due to a pro g ram ming error, electrical noise, or rfi. the watchdog function can be disabled by clearing the wde (watchdog enable) bit in the watchdog control (wdcon) sfr. when enabled, the watch dog circuit will generate a system reset or interrupt (wds) if the user pro gram f ails to set the watchdog (wde) bit within a predetermined amount of time (see pre3? bits in wdcon). the watchdog timer itself is a 16-bit counter that is clocked at 32.768 khz. the wa tchdog timeout interval can be adjusted via the pre3? bits in wdcon. full control and status of the watchdog timer function can be controlled via the watchdog timer control sfr (wdcon). the wdcon sfr can only be written by user software if the double write sequence described in wdwr below is initiated on every write access to the wdcon sfr. ta bl e xix. wdcon sfr bit designations bit name description 7 pre3 watchdog timer prescale bits. 6 pre2 the watchdog timeout period is given by the equation t wd = (2 pre (2 9 /f pll )) 5 pre1 (0 pre 7; f pll = 32.768 khz) 4 pre0 timeout pre3 pre2 pre1 pre0 period (ms) ac tion 0 0 0 0 15.6 reset or interrupt 0 0 0 1 31.2 reset or interrupt 0 0 1 0 62.5 reset or interrupt 0 0 1 1 125 reset or interrupt 0 1 0 0 250 reset or interrupt 0 1 0 1 500 reset or interrupt 0 1 1 0 1000 reset or interrupt 0 1 1 1 2000 reset or interrupt 1 0 0 0 0.0 immediate reset pre3? > 1001 reserved 3 wdir watchdog interrupt re sponse enable bit. if this bit is set by the user, the watchdog will generate an interrupt re sponse in stead of a system reset when the watch dog timeout period has expired. this in ter r upt is not disabled by the clr ea in struc tion, and it is also a xe d, high priority in ter r upt. if the watch dog is not being used to monitor the system, it can alternatively be used as a timer. the prescaler is used to set the timeout period in which an inter r upt will be generated. (see also note 1, table xxxix in the interrupt system section.) 2 wds watchdog status bit. set by the watchdog con trol ler to indicate that a watchdog timeout has occurred. cleared by writing a 0 or by an external hardware reset. it is not cleared by a watchdog reset. 1 wde watchdog enable bit. set by user to enable the watchdog and clear its counters. if a 1 is not written to this bit within the watchdog timeout pe ri od, the watchdog will gen er a te a reset or interrupt, depending on wdir. cleared under the following conditions: user writes 0, watchdog reset (wdir = 0); hardware reset; psm interrupt. 0 wdwr watchdog write enable bit. to write data into the wd con sfr involves a double instruction sequence. the wdwr bit must be set and the ve ry next instruction must be a write instruction to the wdcon sfr. for ex am ple: clr ea ; disable int errupts while writing ; to wdt setb wdwr ; allow write to wdcon mov wdcon, #72h ; enable wdt for 2.0s tim e out setb ea ; enable interrupts again (if rqd) wdcon watchdog timer control register sfr address c0h po w er-on default value 10h bit addressable yes rev. 0
ADUC836 ?43? ta b le xx. psmcon sfr bit designations bit name description 7 cmpd dv dd comparator bit. this is a read-only bit and directly re ects the state of the dv dd com par a tor. read 1 indicates the dv dd supply is above its selected trip point. read 0 indicates the dv dd supply is below its selected trip point. 6 cmpa av dd com par a tor bit. this is a read-only bit and directly re ects the state of the avdd comparator. read 1 indicates the av dd supply is above its selected trip point. read 0 indicates the av dd supply is below its selected trip point. 5 psmi power sup ply monitor interrupt bit. this bit will be set high by the microconverter if either cmpa or cmpd are low, in di cat ing low an a log or dig i tal sup ply. the psmi bit can be used to interrupt the pro ces sor. once cmpd and/or cmpa return (and re main) high, a 250 ms counter is started. when this counter times out, the psmi interrupt is cleared. psmi can also be written by the user. however, if either comparator output is low, it is not pos si ble for the user to clear psmi. 4 tpd1 dv dd tr ip point se lec tion bits. 3 tpd0 these bits select the dv dd trip point voltage as follows: tpd1 tpd0 se lect ed dv dd tr ip point (v) 0 0 4.63 0 1 3.08 1 0 2.93 1 1 2.63 2 tpa1 avdd trip point se lec tion bits. 1 tpa0 these bits select the av dd trip point voltage as follows: tpa1 tpa0 se lect ed av dd tr ip point (v) 0 0 4.63 0 1 3.08 1 0 2.93 1 1 2.63 0 psmen power supply monitor enable bit. set to 1 by the user to enable the power supply monitor circuit. cleared to 0 by the user to disable the power supply monitor circuit. power supply monitor as its name suggests, the power supply monitor, once en abled, monitors both supplies (av dd or dv dd ) on the ADUC836. it will indicate when any of the supply pins drops below one of four user-selectable voltage trip points from 2.63 v to 4.63 v. for cor- rect operation of the power sup ply mon i tor function, av dd must be equal to or greater than 2.7 v. monitor func tion is controlled via the psmcon sfr. if enabled via the ieip2 sfr, the monitor will in ter r upt the core using the psmi bit in the psmcon sfr. this bit will not be cleared until the failing power supply has returned above the trip point for at least 250 ms. this mon i tor func tion allows the user to save working reg is ters to avoid possible data loss due to the low supply con di tion, and also ensures that normal code execution will not re sume until a safe sup ply level has been well es tab lished. the supply mon i tor is also protected against spurious glitches trig ger ing the interrupt circuit. psmcon po we r supply monitor con trol register sfr address dfh po w er-on default value deh bit addressable no rev. 0
ADUC836 ?44? serial peripheral interface the ADUC836 integrates a complete hardware serial peripheral interface (spi) interface on-chip. spi is an industry-standard synchronous serial interface that allows eight bits of data to be synchronously transmitted and received si mul ta neous ly, i.e., full- duplex. it should be noted that the spi pins sclock and mosi are multiplexed with the i 2 c pins sclock and sdata. the pins are controlled via the i2ccon sfr only if spe is clear. spi can be con g ured for mas ter or slave op er a tion and typ i cal ly con sists of four pins: sclock (serial clock i/o pin), pin 26 the master clock (sclock) is used to synchronize the data being transmitted and received through the mosi and miso data lines. a single data bit is transmitted and received in each sclock period. therefore, a byte is transmitted/received after eight sclock periods. the sclock pin is con gured as an output in master mode and as an input in slave mode. in master mode, the bit rate, polarity, and phase of the clock are controlled by the cpol, cpha, spr0, and spr1 bits in the spicon sfr (see table xxi). in slave mode, the spicon reg is ter will have to be con gured with the phase and polarity (cpha and cpol) as the master, as for both master and slave modes the data is transmitted on one edge of the sclock signal and sampled on the other. miso (master in, slave out data i/o pin), pin 14 the miso (master in slave out) pin is con gured as an input line in master mode and an output line in slave mode. the miso line on the master (data in) should be connected to the miso line in the slave device (data out). the data is transferred as byte- wide (8-bit) serial data, msb rst. mosi (master out, slave in pin), pin 27 the mosi (master out slave in) pin is con gured as an output line in master mode and an input line in slave mode. the mosi line on the master (data out) should be connected to the mosi line in the slave device (data in). the data is transferred as byte- wide (8-bit) serial data, msb rst. ss (slave select input pin), pin 13 the slave select ( ss ) input pin is only used when the ADUC836 is con gured in spi slave mode. this line is active low. data is only received or transmitted in slave mode when the ss pin is low, allowing the ADUC836 to be used in single master, multislave spi con gurations. if cpha = 1, the ss input may be permanently pulled low. with cpha = 0, the ss input must be driven low before the r st bit in a byte wide trans mis sion or reception and return high again after the last bit in that byte-wide transmission or reception. in spi slave mode, the logic level on the external ss pin (pin 13) can be read via the spr0 bit in the spicon sfr. the following sfr registers are used to control the spi in ter f ace. ta b le xxi. spicon sfr bit designations bit name description 7 ispi spi interrupt bit. set by microconverter at the end of each spi transfer. cleared directly by user code or indirectly by reading the spidat sfr. 6 wcol write col li sion error bit. set by microconverter if spidat is written to while an spi transfer is in progress. cleared by user code. 5 spe spi interface enable bit. set by user to enable the spi interface. cleared by user to enable the i 2 c interface. 4 spim spi master/slave mode select bit. set by user to enable mas ter mode operation (sclock is an output). cleared by user to enable slave mode operation (sclock is an input). 3 cpol * clock po lar i ty select bit. set by user if sclock idles high. cleared by user if sclock idles low. 2 cpha * clock phase select bit. set by user if leading sclock edge is to transmit data. cleared by user if trailing sclock edge is to transmit data. 1 spr1 spi bit rate select bits. 0 spr0 these bits select the sclock rate (bitrate) in master mode as follows: spr1 spr0 selected bit rate 0 0 f core /2 0 1 f core /4 1 0 f core /8 1 1 f core /16 in spi slave mode, i.e., spim = 0, the logic level on the external ss pin (pin 13), can be read via the spr0 bit. * the cpol and cpha bits should both contain the same values for master and slave devices. rev. 0
ADUC836 ?45? spidat spi data register function the spidat sfr is written by the user to transmit data over the spi interface or read by us er code to read data just received by the spi interface. sfr address f7h po w er-on default value 00h bit addressable no depending on the con guration of the bits in the spicon sfr shown in table xxi, the ADUC836 spi interface will transmit or receive data in a number of possible modes. figure 34 shows all possible ADUC836 spi con gurations and the timing re la - tion ships and synchronization between the signals involved. also shown in this gure is the spi interrupt bit (ispi) and how it is triggered at the end of each byte-wide communication. sclock (cp ol = 1) sclock (cp ol = 0) (cpha = 1) (cpha = 0) sample input ispi flag data output ispi flag sample input data output ? msb bit 6 bit 5 ? bit 4 bit 3 bit 2 bit 1 lsb msb bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 lsb ss figure 34. spi timing, all modes spi interface?aster mode in master mode, the sclock pin is always an output and gen- erates a burst of eight clocks whenever user code writes to the spidat register. the sclock bit rate is determined by spr0 and spr1 in spicon. it should also be noted that the ss pin is not used in master mode. if the ADUC836 needs to assert the ss pin on an external slave device, a port digital out put pin should be used. in master mode, a byte transmission or reception is initiated by a write to spidat. eight clock periods are generated via the sclock pin and the spidat byte being transmitted via mosi. with each sclock period, a data bit is also sampled via miso. after eight clocks, the transmitted byte will have been completely transmitted and the input byte will be waiting in the input shift register. the ispi ag will be set automatically and an interrupt will occur if enabled. the value in the shift register will be latched into spidat. spi interface?lave mode in slave mode, the sclock is an input. the ss pin must also be driven low externally during the byte communication. trans- mis sion is also initiated by a write to spidat. in slave mode, a data bit is transmitted via miso and a data bit is received via mosi through each input sclock period. after eight clocks, the transmitted byte will have been completely transmitted and the input byte will be waiting in the input shift register. the ispi ag will be set automatically and an interrupt will occur if enabled. the value in the shift register will be latched into spidat only when the transmission/reception of a byte has been completed. the end of transmission occurs after the eighth clock has been received, if cpha = 1 or when ss returns high if cpha = 0. rev. 0
ADUC836 ?46? i 2 c serial interface the ADUC836 supports a fully licensed * i 2 c serial in ter f ace. the i 2 c interface is implemented as a full hardware slave and soft- w are master. sdata (pin 27) is the data i/o pin and sclock (pin 26) is the serial clock. these two pins are shared with the mosi and sclock pins of the on-chip spi interface. therefore the user can enable only one in ter f ace or the other at any given time (see spe in table xxi). application note uc001 de scribes the operation of this in ter f ace as im ple ment ed and is avail able from the microconverter website at: www.analog.com/microconverter. three sfrs are used to control the i 2 c interface. these are described below. ta b le xxii. i2ccon sfr bit designations bit name description 7 mdo i 2 c software master data output bit (master mode only). this data bit is used to implement a master i 2 c transmitter interface in soft w are. data written to this bit will be output on the sdata pin if the data output en able (mde) bit is set. 6 mde i 2 c software master data output enable bit (master mode only). set by user to enable the sdata pin as an output (tx). cleared by user to en able sdata pin as an input (rx). 5 mco i 2 c software master clock output bit (master mode only). this data bit is used to implement a master i 2 c transmitter interface in soft w are. data written to this bit will be out put on the sclock pin. 4 mdi i 2 c software master data input bit (master mode only). this data bit is used to implement a master i 2 c receiver in ter f ace in software. data on the sda ta pin is latched into this bit on sclock if the data output enable (mde) bit is 0. 3 i2cm i 2 c master/slave mode bit. set by user to enable i 2 c software master mode. cleared by user to enable i 2 c hardware slave mode. 2 i2crs i 2 c reset bit (slave mode only). set by user to reset the i 2 c interface. cleared by user code for normal i 2 c operation. 1 i2ctx i 2 c direction transfer bit (slave mode only). set by microconverter if the interface is transmitting. cleared by the mi cro con vert er if the interface is receiving. 0 i2ci i 2 c interrupt bit (slave mode only). set by the microconverter after a byte has been transmitted or re ceived. cleared automatically when the user code reads the i2cdat sfr (see i2cdat below). i2ccon i 2 c control register sfr address e8h po w er-on default value 00h bit addressable yes i2cadd i 2 c address register function holds the i 2 c peripheral address for the part. it may be overwritten by the user code. application note uc001 at www.analog.com/microconverter describes the format of the i 2 c standard 7-bit address in detail. sfr address 9bh po w er-on default value 55h bit addressable no i2cdat i 2 c data register function the i2cdat sfr is written by the user to trans mit data over the i 2 c interface or read by user code to read data just received by the i 2 c interface. accessing i2cdat automatically clears any pending i 2 c interrupt and the i2ci bit in the i2ccon sfr. user software should access i2cdat only once per interrupt cycle. sfr address 9ah po w er-on default value 00h bit addressable no * purchase of licensed i 2 c components of analog devices or one of its sublicensed associated companies conveys a license for the purchaser under the phi lips i 2 c pa tent rights to use these components in an i 2 c system provided that the system conforms to the i 2 c standard spec i ca tion as de ned by philips. rev. 0
ADUC836 ?47? the main features of the microconverter i 2 c interface are: only two bus lines are required: a serial data line (sdata) and a serial clock line (sclock). an i 2 c master can communicate with multiple slave devices. because each slave device has a unique 7-bit address, single master/slave re la tion ships can exist at all times even in a multislave environment (figure 35). on-chip ltering rejects <50 ns spikes on the sdata and sclock lines to preserve data integrity. dv dd i 2 c master i 2 c slave #1 i 2 c slave #2 figure 35. typical i 2 c system software master mode the ADUC836 can be used as an i 2 c master device by con g ur ing the i 2 c peripheral in master mode and writing software to out put the data bit by bit, which is referred to as a software mas ter. master mode is enabled by setting the i2cm bit in the i2ccon register. to transmit data on the sdata line, mde must be set to enable the output driver on the sdata pin. if mde is set, the sdata pin will be pulled high or low de pend ing on wheth er the mdo bit is set or cleared. mco controls the sclock pin and is always con g ured as an output in master mode. in master mode, the sclock pin will be pulled high or low de pend ing on the wheth er mco is set or cleared. to receive data, mde must be cleared to disable the out put driver on sdata. software must provide the clocks by tog gling the mco bit and reading the sdata pin via the mdi bit. if mde is cleared, mdi can be used to read the sdata pin. the value of the sdata pin is latched into mdi on a rising edge of sclock. mdi is set if the sdata pin was high on the last rising edge of sclock. mdi is clear if the sdata pin was low on the last r ising edge of sclock. software must control mdo, mco, and mde appropriately to generate the start condition, slave ad dress, ac knowl edge bits, data bytes, and stop conditions. these functions are provided in application note uc001. hardware slave mode after reset, the ADUC836 defaults to hardware slave mode. the i 2 c interface is enabled by clearing the spe bit in spicon. slave mode is enabled by clearing the i2cm bit in i2ccon. the ADUC836 has a full hardware slave. in slave mode, the i 2 c ad dress is stored in the i2cadd reg is ter. data re ceived or to be trans mit ted is stored in the i2cdat register. once enabled in i 2 c slave mode, the slave controller waits for a start condition. if the ADUC836 detects a valid start con- di tion fol lowed by a valid address, and by the r/ w bit, the i2ci interrupt bit will be automatically set by hardware. the i 2 c peripheral will only generate a core interrupt if the user has precon gured the i 2 c interrupt enable bit in the ieip2 sfr as well as the global interrupt bit ea in the ie sfr, i.e., ; enabling i2c in ter rupts for the ADUC836 mov ieip2,#01h ; enable i2c interrupt setb ea on the ADUC836, an auto clear of the i2ci bit is im ple ment ed so this bit is cleared automatically on a read or write access to the i2cdat sfr. mov i2cdat, a ; i2ci auto-cleared mov a, i2cdat ; i2ci auto-cleared if for any reason the user tries to clear the in ter r upt more than once, i.e., access the data sfr more than once per interrupt, then the i 2 c controller will halt. the interface will then have to be reset using the i2crs bit. the user can choose to poll the i2ci bit or enable the in ter r upt. in the case of the interrupt, the pc counter will vector to 003bh at the end of each complete byte. for the r st byte when the user gets to the i2ci isr, the 7-bit address and the r/ w bit will app ear in the i2cdat sfr. the i2ctx bit contains the r/ w bit sent from the master. if i2ctx is set, the master would like to receive a byte. therefore, the slave will trans mit data by writ ing to the i2cdat register. if i2ctx is cleared, the master would like to transmit a byte. therefore, the slave will re ceive a serial byte. the software can in ter ro gate the state of i2ctx to determine whether it should write to or read from i2cdat. once the ADUC836 has received a valid address, hardware will hold sclock low until the i2ci bit is cleared by the software. this allows the master to wait for the slave to be ready before transmitting the clocks for the next byte. the i2ci interrupt bit will be set every time a complete data byte is received or transmitted provided it is followed by a valid ack. if the byte is followed by a nack, an interrupt is gen er at ed. the ADUC836 will continue to issue in ter r upts for each complete data byte transferred until a stop condition is received or the interface is reset. when a stop condition is received, the interface will reset to a state where it is waiting to be addressed (idle). sim i lar ly, if the interface receives a nack at the end of a sequence, it also re turns to the default idle state. the i2crs bit can be used to reset the i 2 c interface. this bit can be used to force the in ter f ace back to the default idle state. it should be noted that there is no way (in hardware) to dis tin guish be tween an in ter r upt generated by a re ceived start + valid address and an in ter r upt generated by a re ceived data byte. user software must be used to distinguish between these interrupts. rev. 0
ADUC836 ?48? ta b le xxiii. dpcon sfr bit designations bit name description 7 reserved for future use 6 dpt data pointer automatic toggle enable. cleared by user to disable auto swapping of the dptr. set in user software to enable automatic toggling of the dptr after each movx or movc instruction. 5 dp1m1 shadow data pointer mode. 4 dp1m0 these two bits enable extra modes of the shadow data pointer operation, allowing for more compact and more ef cient code size and execution. m1 m0 behavior of the shadow data pointer 0 0 8052 behavior 0 1 dptr is post-incremented after a movx or movc instruction. 1 0 dptr is post-decremented after a movx or movc instruction. 1 1 dptr lsb is toggled after a movx or movc instruction. (this instruction can be useful for moving 8-bit blocks to/from 16-bit devices.) 3 dp0m1 main data pointer mode. 2 dp0m0 these two bits enable extra modes of the main data pointer operation, allowing for more com pact and more ef cient code size and ex e cu tion. m1 m0 behavior of the main data pointer 0 0 8052 behavior 0 1 dptr is post-incremented after a movx or movc instruction. 1 0 dptr is post-decremented after a movx or movc instruction. 1 1 dptr lsb is toggled aftera movx or movc instruction. (this instruction can be useful for moving 8-bit blocks to/from 16-bit devices.) 1 this bit is not implemented to allow the inc dpcon instruction to toggle the data pointer wi thout incre- menting the rest of the sfr. 0 dpsel data pointer select. cleared by user to select the main data pointer. this means that the con tents of the main 24-bit dptr appears in the three sfrs: dpl, dph, and dpp. set by user to select the shadow data pointer. this means that the con tents of the shadow 24-bit dptr appears in the three sfrs: dpl, dph, and dpp. notes 1. this is the only place where the main and shadow data pointers are distinguished. everywhere else in this data sheet, wher ev er the dptr is mentioned, operation on the active dptr is implied. 2. only movc/movx @dptr instructions are rel e v ant above. movc/movx pc/@ri instructions will not cause the dptr to automatically post increment/decrement, and so on. to illustrate the operation of dpcon, the following code will copy 256 bytes of code memory at address d000h into xr am starting from address 0000h. the code uses 16 bytes and 2054 cycles. to perform this on a standard 8051 requires ap prox i mate ly 33 bytes and 7172 cycles (depending on how it is im ple ment ed). mov dptr,#0 ; main dptr = 0 mov dpcon,#55h ; select shadow dptr ; dptr1 increment mode, ; dptr0 in cre ment mode ; dptr auto toggling on mov dptr,#0d000h ; shadow dptr = d000h moveloop: clr a movc a,@a+dptr ; get data ; post inc dptr ; swap to main dptr (data) movx @dptr,a ; put acc in xram ; increment main dptr ; swap to shad dptr (code) mov a, dpl jnz moveloop dual data pointer the ADUC836 incorporates both main and shadow data pointers. the shadow data pointer is selected via the data point er con trol sfr (dpcon). dpcon also includes features such as automatic hardware post-increment and post-dec re ment, as well as automatic data pointer toggle. dpcon is described in table xxiii. dpcon data pointer con trol sfr sfr address a7h po w er-on default value 00h bit addressable no rev. 0
ADUC836 ?49? port 1 po rt 1 is also an 8-bit port directly controlled via the p1 sfr. the port 1 pins are divided into two distinct pin groupings: p1.0 to p1.1 and p1.2 to p1.7. p1.0 and p1.1 p1.0 and p1.1 are bidirectional digital i/o pins with internal pull-ups. if p1.0 and p1.1 have 1s written to them via the p1 sfr, they are pulled high by the internal pull-up resistors. in this state, they can also be used as inputs. as input pins being ex ter nal ly pulled low, they will source current because of the internal pull-ups. with 0s written to them, both of these pins will drive a logic low output v oltage (v ol ) and will be capable of sinking 10 ma compared to the standard 1.6 ma sink capability on the other port pins. these pins also have various secondary functions described in t able xxiv. the timer 2 alternate functions of p1.0 and p1.1 can only be activated if the corresponding bit latch in the p1 sfr contains a 1. otherwise, the port pin is stuck at 0. in the case of the pwm outputs at p1.0 and p1.1, the pwm outputs will over- write anything written to p1.0 or p1.1. ta b le xxiv. p1.0 and p1.1 alternate pin functions pin alternate function p1.0 t2 (timer/counter 2 external input) pwm0 (pwm0 output at this pin) p1.1 t2ex (timer/counter 2 capture/reload trigger) pwm1 (pwm1 output at this pin) figure 37 shows a typical bit latch and i/o buffer for a p1.0 or p1.1 port pin. no external memory access is required from either of these pins, although internal pull-ups are present. read latch internal bus write to latch read pin d cl q q latch p1.x pin alternate output function dv dd internal pull-up * * see figure 38 for details of internal pull-up alternate input function figure 37. p1.0 and p1.1 bit latch and i/o buffer the internal pull-up consists of active circuitry, as shown in fig ure 38. whenever a p1.0 or p1.1 bit latch transitions from low to high, q1 in figure 38 turns on for two oscillator periods to quick ly pull the pin to a logic high state. once there, the weaker q3 turns on, thereby latching the pin to a logic high. if the pin is momentarily pulled low externally, q3 will turn off, but the ve ry weak q2 will continue to source some current into the pin, a ttempting to restore it to a logic high. q from port latch 2 clk delay q1 dv dd q2 dv dd q3 dv dd px.x pin q4 figure 38. internal pull-up con guration 8052 compatible on-chip peripherals this section gives a brief overview of the various secondary per ipheral circuits, which are also available to the user on-chip. these remaining functions are mostly 8052 compatible (with a few additional features) and are controlled via standard 8052 sfr bit de nitions. p arallel i/o the ADUC836 uses four input/output ports to exchange data with external devices. in addition to performing general-purpose i/o, some ports are capable of external memory operations while others are multiplexed with alternate functions for the peripheral features on the device. in general, when a peripheral is enabled, that pin may not be used as a general-purpose i/o pin. port 0 po rt 0 is an 8-bit open-drain bidirectional i/o port that is directly controlled via the port 0 sfr. port 0 is also the mul ti plexed low order address and data bus during accesses to ex ter nal pro g ram or data memory. figure 36 shows a typical bit latch and i/o buffer for a port 0 port pin. the bit latch (one bit in the ports sfr) is represented as a type d ip- op, which will clock in a value from the in ter nal b us in response to a ?rite to latch signal from the cpu. the q output of the ip- op is placed on the internal bus in response to a ?ead latch signal from the cpu. the level of the port pin itself is placed on the internal bus in response to a ?ead pin signal from the cpu. some instructions that read a port activate the ?ead latch signal, and others activate the ?ead pin signal. see the read-modify-write in struc tions sec tion for more details. control read latch internal bus write to latch read pin d cl q q latch dv dd addr/data p0.x pin figure 36. port 0 bit latch and i/o buffer as shown in figure 36, the output drivers of port 0 pins are s wit ch able to an internal addr and addr/data bus by an in ter nal con trol signal for use in external memory accesses. during external memory accesses, the p0 sfr is written with 1s (i.e., all of its bit latches become 1s). when accessing ex ter nal memory, the control signal in figure 36 goes high, en abling push-pull operation of the output pin from the internal address or data bus (addr/data line). therefore, no ex ter nal pull-ups are required on port 0 for it to access external mem o ry. in general-purpose i/o port mode, port 0 pins that have 1s writ- ten to them via the port 0 sfr will be con gured as open-drain and therefore will oat. in this state, port 0 pins can be used as high impedance inputs. this is represented in figure 36 by the nand gate whose output remains high as long as the control signal is low, thereby disabling the top fet. ex ter nal pull-up resistors are therefore required when port 0 pins are used as general-purpose outputs. port 0 pins with 0s written to them will drive a logic low output voltage (v ol ) and will be capable of sink- ing 1.6 ma. rev. 0
ADUC836 ?50? p1.2 to p1.7 the remaining port 1 pins (p1.2 to p1.7) can only be con gured as analog input (adc) or digital input pins. by (power-on) default, these pins are con gured as analog inputs, i.e., 1 writ ten in the cor re spond ing port 1 register bit. to con gure any of these pins as digital inputs, the user should write a 0 to these port bits to con gure the cor re spond ing pin as a high im ped ance digital input. figure 39 il lus trates this function. note that there are no output drivers for port 1 pins, and they there fore cannot be used as outputs. read latch internal bus write to latch read pin d cl q q latch p1.x pin to adc figure 39. p1.2 to p1.7 bit latch and i/o buffer port 2 po rt 2 is a bidirectional port with internal pull-up resistors di rect ly controlled via the p2 sfr. port 2 also emits the high order address bytes during fetches from external program mem o ry and middle and high order address bytes during ac cess es to the 24-bit exter nal data memory space. as shown in figure 40, the output drivers of port 2 are swit ch able to an internal addr bus by an internal con trol signal for use in external memory accesses (as for po rt 0). in exter nal memory addressing mode (control = 1), the port pins fea ture push/ pull operation controlled by the in ter nal address bus (addr l ine). however, unlike the p0 sfr during external memory accesses, the p2 sfr remains un changed. in general-purpose i/o port mode, port 2 pins that have 1s writ ten to them are pulled high by the internal pull-ups (figure 38), and in that state can be used as inputs. as inputs, port 2 pins being pulled externally low will source current be cause of the internal pull-up resistors. port 2 pins with 0s writ ten to them will drive a logic low output voltage (v ol ) and will be capable of sinking 1.6 ma. control read latch internal bus write to latch read pin d cl q q latch dv dd addr p2.x pin dv dd internal pull-up * * see figure 38 for details of internal pull-up figure 40. port 2 bit latch and i/o buffer port 3 po rt 3 is a bidirectional port with internal pull-ups directly con trolled via the p3 sfr. po rt 3 pins that have 1s written to them are pulled high by the internal pull-ups, and in that state can be used as inputs. as inputs, po rt 3 pins being pulled externally low will source cur rent because of the internal pull-ups. port 3 pins with 0s writ ten to them will drive a logic low output voltage (v ol ) and will be capable of sink- ing 1.6 ma. po rt 3 pins also have various secondary functions described in t able xxv. the alternate functions of port 3 pins can be activated only if the corresponding bit latch in the p3 sfr contains a 1. otherwise, the port pin is stuck at 0. ta b le xxv. port 3, alternate pin functions pin alternate function p3.0 rxd (uart input pin) (or serial data i/o in mode 0) p3.1 txd (uart output pin) (or serial clock output in mode 0) p3.2 int0 (external interrupt 0) p3.3 int1 (external interrupt 1) p3.4 t0 (timer/counter 0 external input) pwmclk (pwm external clock) p3.5 t1 (timer/counter 1 external input) p3.6 wr (external data memory write strobe) p3.7 rd (external data memory read strobe) po rt 3 pins have the same bit latch and i/o buffer con g u ra tions as the p1.0 and p1.1, as shown in figure 41. the internal pull-up con guration is also de ned by the one in figure 38. read latch internal bus write to latch read pin d cl q q latch dv dd p3.x pin internal pull-up * * see figure 38 for details of internal pull-up alternate output function alternate input function figure 41. port 3 bit latch and i/o buffer additional digital i/o in addition to the port pins, the dedicated spi/i2c pins (sclock and sdata/mosi) also feature both input and output func tions. their equivalent i/o architectures are il lus trat ed in figure 42 and figure 44, respectively, for spi operation, and in figure 43 and figure 45 for i 2 c operation. notice that in i 2 c mode (spe = 0), the strong pull-up fet (q1) is disabled leaving only a weak pull-up (q2) present. by con trast, in spi mode (spe = 1), the strong pull-up fet (q1) is controlled directly by spi hardware, giving the pin push/pull capability. in i 2 c mode (spe = 0), two pull-down fets (q3 and q4) op er a te in parallel in order to provide an extra 60% or 70% of cur rent sinking capability. in spi mode, however, (spe = 1), only one of the pull-down fets (q3) operates on each pin re sult ing in sink capabilities identical to that of port 0 and port 2 pins. on the input path of sclock, notice that a schmitt trigger conditions the signal going to the spi hardware to prevent false triggers (double triggers) on slow incoming edges. for incoming signals from the sclock and sdata pins going to i 2 c hard w are, a lter conditions the signals to reject glitches of up to 50 ns in duration. rev. 0
ADUC836 ?51? notice also that direct access to the sclock and sdata/mosi pins is afforded through the sfr interface in i 2 c mas ter mode. therefore, if you are not using the spi or i 2 c func tions, you can use these two pins to provide additional high current digital outputs. hardware spi (master/slave) q3 schmitt trigger q1 q2 (off) dv dd sclock pin q4 (off) spe = 1 (spi enable) figure 42. sclock pin i/o functional equivalent in spi mode mco i 2 cm sfr bits 50ns glitch rejection filter hardware i 2 c (slave only) q3 q4 sclock pin q2 q1 (off) dv dd spe = 0 (i 2 c e nable) figure 43. sclock pin i/o functional equivalent in i 2 c mode hardware spi (master/slave) q3 q1 q2 (off) dv dd sdata/ mosi pin q4 (off) spe = 1 (spi enable) figure 44. sdata/mosi pin i/o functional equiv a lent in spi mode q3 q4 q2 q1 (off) dv dd mdi mdo mde i2cm hardware i 2 c (slave only) 50ns glitch rejection filter sdata/ mosi pin sfr bits spe = 0 (i 2 c e nable) figure 45. sdata/mosi pin i/o functional equiv a lent in i 2 c mode as shown in figure 46, the miso pin in spi master/slave op er a- tion offers the exact same pull-up and pull-down con g u ra tion as the mosi pin in spi slave/master operation. the ss pin has a weak internal pull-up permanently enabled to prevent the ss input from oating. this pull-up can be easily ov erdriven by an external device to drive the ss pin low. hardware spi (master/slave) miso pin dv dd figure 46. miso pin i/o functional equivalent hardware spi (master/slave) ss pin dv dd figure 47. ss pin i/o functional equivalent read-modify-write instructions some 8051 instructions that read a port, read the latch and others read the pin. the instructions that read the latch rather than the pins are the ones that read a value, possibly change it, and then rewrite it to the latch. these are called ?ead-modify- write instructions. which are listed below. when the destination operand is a port or a port bit, these instructions read the latch rather than the pin. anl (logical and, e.g., anl p1, a) orl (logical or, e.g., orl p2, a) xrl (logical ex-or, e.g., xrl p3, a) jbc (jump if bit = 1 and clear bit, e.g., jbc p1.1, label cpl (complement bit, e.g., cpl p3.0) inc (increment, e.g., inc p2) dec (decrement, e.g., dec p2) djnz (decrement and jump iff not zero, e.g.,djnz p3, label) mov px.y, c * (move carry to bit y of port x) clr px.y * (clear bit y of port x) setb px.y * (set bit y of port x) * these instructions read the port byte (all eight bytes), modify the addressed bit and then write the new byte back to the latch. the reason that read-modify-write instructions are directed to the latch rather than to the pin is to avoid a possible mis in ter - pre ta tion of the voltage level of a pin. for example, a port pin might be used to drive the base of a transistor. when a 1 is written to the bit, the transistor is turned on. if the cpu then reads the same port bit at the pin rather than the latch, it will read the base v oltage of the transistor and interpret it as a logic 0. read ing the latch rather than the pin will return the correct value of 1. rev. 0
ADUC836 ?52? tmod timer/counter 0 and 1 mode register sfr address 89h po w er-on default value 00h bit addressable no ta b le xxvi. tmod sfr bit designations bit name description 7 gate timer 1 gating control. set by software to enable timer/counter 1 only while int1 pin is high and tr1 control bit is set. cleared by software to enable timer 1 whenever tr1 control bit is set. 6 c/ t timer 1 timer or counter select bit. set by software to select counter operation (input from t1 pin). cleared by software to select timer operation (input from internal system clock). 5 m1 timer 1 mode select bit 1 (used with m0 bit) 4 m0 timer 1 mode select bit 0. m1 m0 0 0 th1 operates as an 8-bit timer/counter. tl1 serves as 5-bit prescaler. 0 1 16-bit timer/counter. th1 and tl1 are cascaded; there is no prescaler. 1 0 8-bit autoreload timer/counter. th1 holds a value that is to be reloaded into tl1 each time it over ows. 1 1 timer/counter 1 stopped. 3 gate timer 0 gating control. set by software to enable timer/counter 0 only while int0 pin is high and tr0 control bit is set. cleared by software to enable timer 0 whenever tr0 control bit is set. 2 c/ t timer 0 timer or counter select bit. set by software to select counter operation (input from t0 pin). cleared by software to select timer operation (input from internal system clock). 1 m1 timer 0 mode select bit 1 0 m0 timer 0 mode select bit 0. m1 m0 0 0 th0 operates as an 8-bit timer/counter. tl0 serves as 5-bit prescaler. 0 1 16-bit timer/counter. th0 and tl0 are cascaded; there is no prescaler. 1 0 8-bit autoreload timer/counter. th0 holds a value that is to be reloaded into tl0 each time it over ows. 1 1 tl0 is an 8-bit timer/counter controlled by the standard timer 0 control bits. th0 is an 8-bit timer only, controlled by timer 1 con trol bits. timers/counters the ADUC836 has three 16-bit timer/counters: timer 0, timer 1, and timer 2. the timer/counter hardware has been included on-chip to relieve the processor core of the overhead inherent in implementing timer/counter functionality in soft w are. each timer/counter consists of two 8-bit registers: thx and tlx (x = 0, 1, and 2). all three can be con gured to op er a te either as timers or event counters. in timer function, the tlx register is incremented every ma chine c ycle. thus it can be viewed as counting machine cy cles. since a ma chine cycle consists of 12 core clock periods, the maximum count rate is 1/12 of the core clock frequency. in counter function, the tlx register is incremented by a 1-to-0 transition at its corresponding external input pin, t0, t1, or t2. in this function, the external input is sampled during s5p2 of every machine cycle. when the samples show a high in one cycle and a low in the next cycle, the count is incremented. the new count value appears in the register during s3p1 of the cycle fol- lowing the one in which the transition was detected. since it takes two machine cycles (16 core clock periods) to recognize a 1-to-0 transition, the maximum count rate is 1/16 of the core clock fre- quency. there are no restrictions on the duty cycle of the external input signal, but to ensure that a given level is sampled at least once before it changes, it must be held for a minimum of one full machine cycle. remember that the core clock frequency is pro- g rammed via the cd0? selection bits in the pllcon sfr. user con guration and control of the timers is achieved via three main sfrs: tmod and tcon control the con guration of timers 0 and 1, while t2con con gures timer 2. rev. 0
ADUC836 ?53? tcon timer/counter 0 and 1 control register sfr address 88h po w er-on default value 00h bit addressable yes ta b le xxvii. tcon sfr bit designations bit name description 7 tf1 timer 1 over ow flag. set by hardware on a timer/counter 1 over ow. cleared by hardware when the program counter (pc) vectors to the interrupt service routine. 6 tr1 timer 1 run control bit. set by user to turn on timer/counter 1. cleared by user to turn off timer/counter 1. 5 tf0 timer 0 over ow flag. set by hardware on a timer/counter 0 over ow. cleared by hardware when the pc vectors to the interrupt service routine. 4 tr0 timer 0 run control bit. set by user to turn on timer/counter 0. cleared by user to turn off timer/counter 0. 3 ie1 * external interrupt 1 (int1) flag. set by hardware by a falling edge or zero level being applied to external in ter ru pt pin int1, depending on bit it1 state. cleared by hardware when the pc vectors to the interrupt service routine only if the interrupt was transition- ac ti vat ed. if level-activated, the external requesting source rather than the on-chip hardware, controls the request ag. 2 it1 * external interrupt 1 (ie1) trigger type. set by software to specify edge-sensitive detection (i.e., 1-to-0 transition). cleared by software to specify level-sensitive detection (i.e., zero level). 1 ie0 * external interrupt 0 (int0) flag. set by hardware by a falling edge or zero level being applied to external in ter ru pt pin int0, depending on bit it0 state. cleared by hardware when the pc vectors to the interrupt service routine only if the interrupt was transition- activated. if level-activated, the external requesting source controls the request ag, rather than the on-chip hardware. 0 it0 * external interrupt 0 (ie0) trigger type. set by software to specify edge-sensitive detection (i.e., 1-to-0 tran si tion). cleared by software to specify level-sensitive detection (i.e., zero level). * these bits are not used in the control of timer/counter 0 and 1, but are used instead in the control and monitoring of the exte r nal int0 and int1 interrupt pins. timer/counter 0 and 1 data registers both timer 0 and timer 1 consist of two 8-bit registers. these can be used as independent registers or combined to be a sin gle 16-bit register, de pend ing on the timer mode con guration. th0 and tl0 timer 0 high byte and low byte. sfr address = 8ch, 8ah, respectively. th1 and tl1 timer 1 high byte and low byte. sfr address = 8dh, 8bh, respectively. rev. 0
ADUC836 ?54? timer/counter 0 and 1 operating modes the following paragraphs describe the operating modes for timer/ counters 0 and 1. unless otherwise noted, it should be assumed that these modes of operation are the same for both timer 0 and 1. mode 0 (13-bit timer/counter) mode 0 con gures an 8-bit timer/counter with a divide-by-32 prescaler. figure 48 shows mode 0 operation. 12 core clk * control p3.4/t0 gate p3.2/ int0 tr0 tf0 tl0 (5 bits) th0 (8 bits) interrupt c/ t = 0 * the core clock is the output of the pll (see the on-chip pll section) c/ t = 1 figure 48. timer/counter 0, mode 0 in this mode, the timer register is con gured as a 13-bit register. as the count rolls over from all 1s to all 0s, it sets the timer over- ow ag. the over ow ag, tf0, can then be used to re quest an interrupt. the counted input is enabled to the timer when tr0 = 1 and either gate = 0 or int0 = 1. setting gate = 1 allows the timer to be controlled by external input int0 to fa cil i tate pulse- width measurements. tr0 is a control bit in the special function register tcon; gate is in tmod. the 13-bit register consists of all eight bits of th0 and the lower ve bits of tl0. the upper three bits of tl0 are indeterminate and should be ignored. setting the run ag (tr0) does not clear the reg is ters. mode 1 (16-bit timer/counter) mode 1 is the same as mode 0, except that the timer register is r unning with all 16 bits. mode 1 is shown in figure 49. 12 core clk * control p3.4/t0 gate p3.2/ int0 tr0 tf0 tl0 (8 bits) th0 (8 bits) interrupt c/ t = 0 c/ t = 1 * the core clock is the output of the pll (see the on-chip pll section) figure 49. timer/counter 0, mode 1 mode 2 (8-bit timer/counter with auto reload) mode 2 con gures the timer register as an 8-bit counter (tl0) with automatic reload, as shown in figure 50. over ow from tl0 not only sets tf0, but also reloads tl0 with the contents of th0, which are preset by software. the reload leaves th0 unchanged. control tf0 tl0 (8 bits) interrupt reload th0 (8 bits) 12 core clk * p3.4/t0 gate p3.2/ int0 tr0 c/ t = 0 c/ t = 1 * the core clock is the output of the pll (see the on-chip pll section) figure 50. timer/counter 0, mode 2 mode 3 (two 8-bit timer/counters) mode 3 has different effects on timer 0 and timer 1. timer 1 in mode 3 simply holds its count. the effect is the same as setting tr1 = 0. timer 0 in mode 3 establishes tl0 and th0 as two separate counters. this con guration is shown in figure 51. tl0 uses the timer 0 control bits: c/ t , gate, tr0, int0 , and tf0. th0 is locked into a timer function (counting machine cycles) and takes over the use of tr1 and tf1 from timer 1. thus, th0 now controls the timer 1 interrupt. mode 3 is provided for appli- cations requiring an extra 8-bit timer or counter. when timer 0 is in mode 3, timer 1 can be turned on and off by s witching it out of and into its own mode 3, or it can still be used by the serial interface as a baud rate generator. in fact, it can be used in any application not requiring an in ter r upt from timer 1 itself. control tf0 tl0 (8 bits) interrupt 12 core clk * p3.4/t0 gate p3.2/ int0 tr0 c/ t = 0 c/ t = 1 core clk/12 tf1 th0 (8 bits) interrupt core clk/12 tr1 * the core clock is the output of the pll (see the on-chip pll section) figure 51. timer/counter 0, mode 3 rev. 0
ADUC836 ?55? timer/counter 2 operating modes the following paragraphs describe the operating modes for timer/counter 2. the operating modes are selected by bits in the t2con sfr, as shown in table xxix. ta bl e xxviii. timer 2 operating modes rclk (or) tclk cap2 tr2 mode 0 0 1 16-bit autoreload 0 1 1 16-bit capture 1 x 1 baud rate x x 0 off 16-bit autoreload mode autoreload mode has two options, which are selected by bit exen2 in t2con. if exen2 = 0, when timer 2 rolls over, it not only sets tf2 but also causes the timer 2 reg is ters to be reloaded with the 16-bit value in registers rcap2l and rcap2h, which are preset by software. if exen2 = 1, timer 2 still performs the above, but with the added fea ture that a 1-to-0 tran- sition at external input t2ex will also trigger the 16-bit reload and set exf2. the autoreload mode is illustrated in figure 52. 16-bit capture mode capture mode has two options, which are selected by bit exen2 in t2con. if exen2 = 0, timer 2 is a 16-bit timer or counter that, upon over o wing, sets bit tf2, the tim er 2 over ow bit, which can be used to generate an in ter r upt. if exen2 = 1, timer 2 still performs the above, but a l-to-0 transition on external input t2ex causes the current value in t he timer 2 reg isters, tl2 and th2, to be captured into registers rcap2l and rcap2h, respectively. in ad di tion, the transition at t2ex causes bit exf2 in t2con to be set; exf2, like tf2, can generate an interrupt. cap ture mode is illustrated in figure 53. the baud rate generator mode is selected by rclk = 1 and/or tclk = 1. in either case, if timer 2 is being used to generate the baud rate, the tf2 interrupt ag will not occur. therefore timer 2 in ter - r upts will not occur so they do not have to be disabled. however, in this mode, the exf2 ag can still cause in ter r upts and this can be used as a third external interrupt. baud rate generation will be described as part of the uart serial port operation. core clk * 12 t2 pin c/ t2 = 0 c/ t2 = 1 tr2 control tl2 (8 bits) th2 (8 bits) reload tf2 exf2 timer interrupt exen2 control transition detector t2ex pin rcap2l rcap2h * the core clock is the output of the pll (see the on-chip pll section) figure 52. timer/counter 2, 16-bit autoreload mode tf2 core clk * 12 t2 pin tr2 control tl2 (8 bits) th2 (8 bits) capture exf2 timer interrupt exen2 control transition detector t2ex pin rcap2l rcap2h c/ t2 = 0 c/ t2 = 1 * the core clock is the output of the pll (see the on-chip pll section) figure 53. timer/counter 2, 16-bit capture mode rev. 0
ADUC836 ?56? t2con timer/counter 2 control register sfr address c8h po w er-on default value 00h bit addressable yes ta b le xxix. t2con sfr bit designations bit name description 7 tf2 timer 2 over ow flag. set by hardware on a timer 2 over ow . tf2 will not be set when either rclk or tclk = 1. cleared by user software. 6 exf2 timer 2 external flag. set by hardware when either a capture or a reload is caused by a negative transition in t2ex and exen2 = 1. cleared by user software. 5 rclk receive clock enable bit. set by user to enable the serial port to use timer 2 over ow pulses for its receive clock in serial port modes 1 and 3. cleared by user to enable timer 1 over ow to be used for the receive clock. 4 tclk transmit clock enable bit. set by user to enable the serial port to use timer 2 over ow pulses for its transmit clock in serial port modes 1 and 3. cleared by user to enable timer 1 over ow to be used for the trans mit clock. 3 exen2 tim er 2 external enable flag. set by user to enable a capture or reload to occur as a result of a negative transition on t2ex if timer 2 is not being used to clock the serial port. cleared by user for timer 2 to ignore events at t2ex. 2 tr2 timer 2 start/stop control bit. set by user to start timer 2. cleared by user to stop timer 2. 1 cnt2 timer 2 timer or counter function select bit. set by user to select counter function (input from external t2 pin). cleared by user to select timer function (input from on-chip core clock). 0 cap2 timer 2 capture/reload select bit. set by user to enable captures on negative transitions in t2ex when exen2 = 1. cleared by user to enable auto reloads with timer 2 over o ws or negative transitions in t2ex when exen2 = 1. when either rclk = 1 or tclk = 1, this bit is ignored and the timer is forced to autoreload on timer 2 over ow. timer/counter 2 data registers timer/counter 2 also has two pairs of 8-bit data registers as so ci at ed with it. these are used as both timer data reg is ters and timer cap ture/reload registers. th2 and tl2 timer 2, data high byte and low byte. sfr address = cdh, cch, respectively. rcap2h and rcap2l timer 2, capture/reload byte and low byte. sfr address = cbh, cah, respectively. rev. 0
ADUC836 ?57? scon uart serial port con trol registers sfr address 98h po w er-on default value 00h bit addressable yes ta b le xxx. scon sfr bit designations bit name description 7 sm0 uart serial mode select bits. 6 sm1 these bits select the serial port operating mode as follows: sm0 sm1 se lect ed op er at ing mode 0 0 mode 0: shift register, xe d baud rate (f core /12) 0 1 mode 1: 8-bit uart, variable baud rate 1 0 mode 2: 9-bit uart, xe d baud rate (f core /64) or (f core /32) 1 1 mode 3: 9-bit uart, variable baud rate 5 sm2 multiprocessor communication enable bit. enables multiprocessor com mu ni ca tion in modes 2 and 3. in mode 0, sm2 should be cleared. in mode 1, if sm2 is set, ri will not be activated if a valid stop bit was not received. if sm2 is cleared, ri will be set as soon as the byte of data has been re ceived. in modes 2 or 3, if sm2 is set, ri will not be ac ti vat ed if the re ceived ninth data bit in rb8 is 0. if sm2 is cleared, ri will be set as soon as the byte of data has been received. 4 ren serial port receive enable bit. set by user software to enable serial port reception. cleared by user software to dis able serial port reception. 3 tb8 serial port transmit (bit 9). the data loaded into tb8 will be the ninth data bit that will be transmitted in modes 2 and 3. 2 rb8 serial port receiver bit 9. the ninth data bit received in modes 2 and 3 is latched into rb8. for mode 1, the stop bit is latched into rb8. 1 ti serial port transmit interrupt flag. set by hardware at the end of the eighth bit in mode 0, or at the beginning of the stop bit in modes 1, 2, and 3. ti must be cleared by user software. 0 ri serial port receive interrupt flag. set by hardware at the end of the eighth bit in mode 0, or half wa y through the stop bit in modes 1, 2, and 3. ri must be cleared by software. ua rt serial interface the serial port is full-duplex, meaning it can transmit and receive simultaneously. it is also receive-buffered, meaning it can com- mence reception of a second byte before a previously re ceived byte has been read from the receive register. however, if the rs t byte still has not been read by the time reception of the second byte is complete, the r st byte will be lost. the phys i cal interface to the serial data network is via pins rxd(p3.0) and txd(p3.1), while the sfr interface to the uart comprises the following registers: sbuf the serial port receive and transmit registers are both accessed through the sbuf sfr (sfr address = 99h). writing to sbuf loads the transmit register, and reading sbuf accesses a physi- cally separate receive register. ua rt operating modes mode 0: 8-bit shift register mode mode 0 is selected by clearing both the sm0 and sm1 bits in the sfr scon. serial data enters and exits through rxd. txd outputs the shift clock. eight data bits are transmitted or received. t ransmission is initiated by any instruction that writes to sbuf. the data is shifted out of the rxd line. the 8 bits are transmitted with the least signi cant bit (lsb) rs t, as shown in figure 54. reception is initiated when the receive enable bit (ren) is 1 and the receive interrupt bit (ri) is 0. when ri is cleared, the data is clocked into the rxd line and the clock pulses are out put from the txd line. core clk ale rxd (data out) data bit 0 data bit 1 data bit 6 data bit 7 s6 s5 s4 s3 s2 s1 s6 s5 s4 s4 s3 s2 s1 s6 s5 s4 s3 s2 s1 machine cycle 8 machine cycle 7 machine cycle 2 machine cycle 1 txd (shift clock) figure 54. uart serial port transmission, mode 0 rev. 0
ADUC836 ?58? mode 1: 8-bit uart, variable baud rate mode 1 is selected by clearing sm0 and setting sm1. each data byte (lsb r st) is preceded by a start bit (0) and followed by a stop bit (1). therefore 10 bits are transmitted on txd or received on rxd. the baud rate can be set by timer 1 or tim er 2 (or both). alternatively, a dedicated baud rate gen er a tor, timer 3, is pro- vided on-chip to generate high speed, very accurate baud rates. t ransmission is initiated by writing to sbuf. the ?rite to sbuf signal also loads a 1 (stop bit) into the ninth bit position of the transmit shift register. the data is output bit by bit until the stop bit appears on txd and the transmit interrupt ag (ti) is automatically set, as shown in figure 55. txd ti (s con.1) start bit d0 d1 d2 d3 d4 d5 d6 d7 stop bit set interrupt i.e., ready for more data figure 55. uart serial port transmission, mode 0 reception is initiated when a 1-to-0 transition is detected on rxd. assuming a valid start bit was detected, character re cep tion continues. the start bit is skipped and the eight data bits are clocked into the serial port shift register. when all eight bits have been clocked in, the following events occur: the eight bits in the receive shift register are latched into sbuf. the ninth bit (stop bit) is clocked into rb8 in scon. the receiver interrupt ag (ri) is set. if, and only if, the following conditions are met at the time, the nal shift pulse is generated: ri = 0, and either sm2 = 0, or sm2 = 1 and the received stop bit = 1. if either of these conditions is not met, the received frame is irretrievably lost and ri is not set. mode 2: 9-bit uart with fixed baud rate mode 2 is selected by setting sm0 and clearing sm1. in this mode, the uart operates in 9-bit mode with a xe d baud rate. the baud rate is x ed at core_clk/64 by default, although by setting the smod bit in pcon, the frequency can be doubled to core_clk/32. eleven bits are transmitted or received, a start bit (0), eight data bits, a programmable ninth bit, and a stop bit (1). the ninth bit is most often used as a parity bit, although it can be used for any- thing, including a ninth data bit if re quired. * f core refers to the output of the pll as described in the on-chip pll section. to transmit, the eight data bits must be written into sbuf. the ninth bit must be written to tb8 in scon. when trans mis sion is initiated, the eight data bits (from sbuf) are loaded onto the transmit shift register (lsb r st). the contents of tb8 are loaded into the ninth bit position of the transmit shift reg is ter. the trans mis sion will start at the next valid baud rate clock. the ti ag is set as soon as the stop bit appears on txd. reception for mode 2 is similar to that of mode 1. the eight data bytes are input at rxd (lsb rs t) and loaded onto the receive shift register. when all eight bits have been clocked in, the fol- lowing events occur: the eight bits in the receive shift register are latched into sbuf. the ninth data bit is latched into rb8 in scon. the receiver interrupt ag (ri) is set. if, and only if, the following conditions are met at the time the nal shift pulse is generated: ri = 0, and either sm2 = 0, or sm2 = 1 and the received stop bit = 1. if either of these conditions is not met, the received frame is irretrievably lost and ri is not set. mode 3: 9-bit uart with variable baud rate mode 3 is selected by setting both sm0 and sm1. in this mode, the 8051 uart serial port operates in 9-bit mode with a vari able baud rate determined by either timer 1 or timer 2. the operation of the 9-bit uart is the same as for mode 2, but the baud rate can be varied as for mode 1. in all four modes, transmission is initiated by any instruction that uses sbuf as a destination register. reception is initiated in mode 0 by the condition ri = 0 and ren = 1. reception is initi- a ted in the other modes by the incoming start bit if ren = 1. ua rt serial port baud rate generation mode 0 baud rate generation the baud rate in mode 0 is x ed: mode 0 baud rate f core = * 12 mode 2 baud rate generation the baud rate in mode 2 depends on the value of the smod bit in the pcon sfr. if smod = 0, the baud rate is 1/64 of the core clock. if smod = 1, the baud rate is 1/32 of the core clock: mode 2 baud rate f core smo d = * 2 64 mode 1 and 3 baud rate generation tr aditionally, the baud rates in modes 1 and 3 are determined by the over ow rate in timer 1 or timer 2, or both (one for transmit and the other for receive). on the ADUC836, however, the baud rate can also be generated via a separate baud rate generator to achieve higher baud rates and allow all three to be used for other functions. rev. 0
ADUC836 ?59? timer 2 generated baud rates baud rates can also be generated using timer 2. using timer 2 is similar to using timer 1 in that the timer must over ow 16 times before a bit is transmitted/received. because timer 2 has a 16-bit autoreload mode, a wider range of baud rates is pos si ble. mode 1 3 and mode baud rate timer overflow rate = () () 116 2 therefore when timer 2 is used to generate baud rates, the timer increments every two clock cycles and not every core machine cy cle as before. thus, it increments six times faster than timer 1, and therefore baud rates six times faster are pos si ble. because timer 2 has a 16-bit autoreload capability, very low baud rates are still possible. timer 2 is selected as the baud rate generator by setting the tclk and/or rclk in t2con. the baud rates for transmit and receive can be simultaneously different. setting rclk and/or tclk puts timer 2 into its baud rate generator mode, as shown in figure 56. in this case, the baud rate is given by the formula: mode 1 3 and mode baud rate f rcap h l core = ? () 32 65536 2 t able xxxii shows some commonly used baud rates and how they might be calculated from a core clock frequency of 1.5728 mhz and 12.5829 mhz using timer 2. ta b le xxxii. commonly used baud rates, timer 2 ideal core rcap2h rcap2l actual % baud clk value value baud er ror 19200 12.58 ? (ffh) ?0 (ech) 19661 2.4 9600 12.58 ? (ffh) ?1 (d7h) 9591 0.1 1600 12.58 ? (ffh) ?64 (5ch) 2398 0.1 1200 12.58 ? (feh) ?2 (b8h) 1199 0.1 9600 1.57 ? (ffh) ? (fbh) 9830 2.4 1600 1.57 ? (ffh) ?0 (ech) 1658 2.4 1200 1.57 ? (ffh) ?1 (d7h) 1199 0.1 baud rate generation using timer 1 and tim er 2 timer 1 generated baud rates when timer 1 is used as the baud rate generator, the baud rates in modes 1 and 3 are determined by the timer 1 over ow rate and the value of smod as follows: modes 1 3 1 and baud rate timer overflow rate smod =? () () 232 the timer 1 interrupt should be disabled in this application. the timer itself can be con gured for either timer or counter operation, and in any of its three running modes. in the most typical application, it is con gured for timer operation, in the autoreload mode (high nibble of tmod = 0100 binary). in this case, the baud rate is given by the formula: mode 1 3 1 and mode baud rate f th smod core = ? () 2 32 12 256 a very low baud rate can also be achieved with timer 1 by leav ing the timer 1 interrupt enabled, con guring the timer to run as a 16-bit timer (high nibble of tmod = 0100 binary), and using the timer 1 interrupt to do a 16-bit software reload. table xxxi shows some commonly used baud rates and how they might be calculated from a core clock frequency of 1.5728 mhz and 12.58 mhz using timer 1. generally speak ing, a 5% error is tolerable using asynchronous (start/stop) com mu ni ca tions. ta b le xxxi. commonly used baud rates, timer 1 ideal core smod th1-reload actual % baud clk value value baud er ror 9600 12.58 1 ? (f9h) 9362 2.5 1600 12.58 1 ?7 (e5h) 1627 1.1 1200 12.58 1 ?5 (c9h) 1192 0.7 1200 1.57 1 ? (f9h) 1170 2.5 core clk * 2 t2 pin tr2 control tl2 (8 bits) th2 (8 bits) reload exen2 control t2ex pin transition detector exf 2 timer 2 interrupt note availability of additional external interrupt * the core clock is the output of the pll (see the on-chip pll section) rcap2l rcap2h timer 2 overflow 2 16 16 rclk tclk rx clock tx clock 0 0 1 1 1 0 smod timer 1 overflow c/ t2 = 0 c/ t2 = 1 osc. freq. is divided by 2, not 12. figure 56. timer 2, uart baud rates rev. 0
ADUC836 ?60? baud rate generation using timer 3 the high integer dividers in a uart block means that high speed baud rates are not always possible using some particular crystals, e.g., using a 12 mhz crystal, a baud rate of 115200 is not possible. to address this problem, the ADUC836 has added a dedicated baud rate timer (timer 3) speci cally for generating highly accurate baud rates. timer 3 can be used instead of timer 1 or timer 2 for gen er at ing ve ry accurate high speed uart baud rates including 115200 and 230400. timer 3 also allows a much wider range of baud rates to be obtained. in fact, every desired bit rate from 12 bits to 393216 bits can be generated to within an error of ?.8%. timer 3 also frees up the other three timers allowing them to be used for dif- ferent applications. a block diagram of timer 3 is shown in figure 57. (1 + t3fd/64) 2 t3 rx/tx clock core clk * t3en rx clock tx clock timer 1/timer 2 rx clock (fig 44) fractional divider 0 0 1 1 timer 1/timer 2 tx clock (fig 44) 16 2 div * the core clock is the output of the pll (see the on-chip pll section) figure 57. timer 3, uart baud rates tw o sfrs (t3con and t3fd) are used to control timer 3. t3con is the baud rate control sfr, allowing timer 3 to be used to set up the uart baud rate, and setting up the binary divider (div). ta b le xxxiii. t3con sfr bit designations bit name description 7 t3en set to enable timer 3 to generate the baud rate. when set pcon.7, t2con.4 and t2con.5 are ignored. cleared to let the baud rate be generated as per a stan dard 8052. 6 reserved for future use 5 reserved for future use 4 reserved for future use 3 reserved for future use 2 div2 binary divider factor 1 div1 div2 div1 div0 bin divider 0 div0 0 0 0 1 0 0 1 2 0 1 0 4 0 1 1 8 1 0 0 16 1 0 1 32 1 1 0 64 1 1 1 128 the appropriate value to write to the div2-1-0 bits can be cal- culated using the following formula where f core is the output of the pll, as described in the on-chip pll section. note that the div value must be rounded down. div f baud rate core = ? ? ? ? ? ? () log log 32 2 t3fd is the fractional divider ratio required to achieve the required baud rate. we can calculate the appropriate value for t3fd using the following formula. note that the t 3 fd should be rounded to the nearest integer. tfd f baud rate core div 3 2 2 64 = ? once the values for div and t3fd are calculated, the actual baud rate can be calculated using the following formula: actual baud rate f tfd core div = + () 2 2364 f or a baud rate of 115200 while operating from the max i mum core frequency (cd = 0), we have: div tfd dh = () == = () () ?= = log / / log . .. 12582912 32 115200 2 1 77 1 32 12 582912 2 115200 64 45 22 2 1 therefore, the actual baud rate is 115439 bits. ta b le xxxiv. commonly used baud rates using timer 3 ideal % baud cd div t3con t3fd error 230400 0 0 80h 2dh 0.2 115200 0 1 81h 2dh 0.2 115200 1 0 80h 2dh 0.2 57600 0 2 82h 2dh 0.2 57600 1 1 81h 2dh 0.2 57600 2 0 80h 2dh 0.2 38400 0 3 83h 12h 0.1 38400 1 2 82h 12h 0.1 38400 2 1 81h 12h 0.1 38400 3 0 80h 12h 0.1 19200 0 4 84h 12h 0.1 19200 1 3 83h 12h 0.1 19200 2 2 82h 12h 0.1 19200 3 1 81h 12h 0.1 19200 4 0 80h 12h 0.1 9600 0 5 85h 12h 0.1 9600 1 4 84h 12h 0.1 9600 2 3 83h 12h 0.1 9600 3 2 82h 12h 0.1 9600 4 1 81h 12h 0.1 9600 5 0 80h 12h 0.1 38400 0 3 83h 12h 0.1 rev. 0
ADUC836 ?61? interrupt system the ADUC836 provides a total of 11 interrupt sources with two priority levels. the control and con guration of the in ter r upt system are carried out through three interrupt-re lat ed sfrs: the ie (interrupt enable) register, ip (interrupt priority register), and ieip2 (secondary interrupt enable/priority sfr) registers. their bit de nitions are given in the tables xxxv to xxxvii. ie interrupt enable register sfr address a8h po w er-on default value 00h bit addressable yes ta b le xxxv. ie sfr bit designations bit name description 7 ea written by user to enable 1 or disable 0 all interrupt sources 6 eadc written by user to enable 1 or disable 0 adc interrupt 5 et2 written by user to enable 1 or disable 0 timer 2 interrupt 4 es written by user to enable 1 or disable 0 uart serial port interrupt 3 et1 written by user to enable 1 or disable 0 timer 1 interrupt 2 ex1 written by user to enable 1 or disable 0 external interrupt 1 1 et0 written by user to enable 1 or disable 0 timer 0 interrupt 0 ex0 written by user to enable 1 or disable 0 external interrupt 0 ip interrupt priority reg is ter sfr address b8h po w er-on default value 00h bit addressable yes ta bl e xxxvi. ip sfr bit designations bit name description 7 reserved for future use 6 padc written by user to select adc interrupt priority (1 = high; 0 = low) 5 pt2 written by user to select timer 2 interrupt priority (1 = high; 0 = low) 4 ps written by user to select uart serial port interrupt priority (1 = high; 0 = l ow) 3 pt1 written by user to select timer 1 interrupt priority (1 = high; 0 = low) 2 px1 writ ten by user to select external interrupt 1 priority (1 = high; 0 = low) 1 pt0 written by user to select timer 0 interrupt priority (1 = high; 0 = low) 0 px0 written by user to select external interrupt 0 priority (1 = high; 0 = low) ieip2 secondary interrupt enable and priority register sfr address a9h po w er-on default value a0h bit addressable no ta b le xxxvii. ieip2 sfr bit designations bit name description 7 reserved for future use 6 pti writ ten by user to select tic interrupt priority (1 = high; 0 = low) 5 ppsm written by user to select power supply monitor interrupt priority (1 = high; 0 = l ow) 4 psi written by user to select spi/i 2 c serial port interrupt priority (1 = high; 0 = low) 3 reserved. this bit must be 0. 2 eti written by user to enable 1 or disable 0 tic interrupt 1 epsm written by user to enable 1 or disable 0 power supply monitor interrupt 0 esi written by user to enable 1 or disable 0 spi/i 2 c serial port interrupt rev. 0
ADUC836 ?62? interrupt priority the interrupt enable registers are written by the user to enable individual interrupt sources, while the interrupt priority reg is ters allow the user to select one of two priority levels for each inter- r upt. an interrupt of a high priority may interrupt the ser vice routine of a low priority interrupt, and if two interrupts of differ- ent priority occur at the same time, the higher level in ter r upt will be serviced r st. an interrupt cannot be interrupted by another interrupt of the same priority level. if two interrupts of the same priority level occur simultaneously, a polling sequence is used to determine which interrupt is serviced r st. the poll ing sequence is shown in table xxxviii. ta b le xxxviii. priority within an interrupt level source priority description psmi 1 (highest) power supply monitor in ter r upt wds 2 watchdog interrupt ie0 3 external interrupt 0 rdy0/rdy1 4 adc interrupt tf0 5 timer/counter 0 interrupt ie1 6 external interrupt 1 tf1 7 timer/counter 1 interrupt ispi/i2ci 8 spi interrupt ri + ti 9 serial interrupt tf2 + exf2 10 timer/counter 2 interrupt tii 11 (lowest) time interval counter interrupt interrupt vectors when an interrupt occurs, the program counter is pushed onto the stack and the corresponding interrupt vector address is loaded into the program counter. the interrupt vector addresses are shown in table xxxix. ta bl e xxxix. interrupt vector addresses source vector address ie0 0003h tf0 000bh ie1 0013h tf1 001bh ri + ti 0023h tf2 + exf2 002bh rdy0/rdy1 (adc) 0033h ispi/i2ci 003bh psmi 0043h tii 0053h wds (wdir = 1) * 005bh * the watchdog can be con gured to generate an interrupt instead of a reset when it times out. this is used for logging errors or examining the internal status of the microcontroller core to understand, from a software debug point of view, why a watchdog timeout occurred. the watchdog interrupt is slightly different from the normal inter- ru pts in that its priority level is always set to 1 and it is not possible to disable the interrupt via the global disable bit (ea) in the ie sfr. this is done to ensure that the interrupt will always be responded to if a watchdog timeout occurs. the watchdog will only produce an interrupt if the watchdog timeout is greater than zero. rev. 0
ADUC836 ?63? ADUC836 hardware design considerations this section outlines some of the key hardware design con sid er - a tions that must be addressed when integrating the ADUC836 into any hardware system. external memory interface in addition to its internal program and data memories, the ADUC836 can access up to 64 kbytes of external program mem o ry (rom, prom, and so on) and up to 16 mbytes of ex ter nal data memory (sram). to select from which code space (internal or external program memory) to begin executing code, tie the ea (external access) pin high or low, respectively. when ea is high (pulled up to v dd ), user program execution will start at address 0 in the in ter nal 62 kbytes flash/ee code space. when ea is low (tied to ground) user program execution will start at address 0 in the external code space. when executing from internal code space, accesses to the program space above f7ffh (62 kbytes) will be read as nop instructions. note that a second very important function of the ea pin is described in the single pin emulation mode section. external program memory (if used) must be connected to the ADUC836, as illustrated in figure 58. sixteen i/o lines (ports 0 and 2) are dedicated to bus functions during external program mem o ry fetches. port 0 (p0) serves as a multiplexed address/data bu s. it emits the low byte of the program counter (pcl) as an address, and then goes into a high impedance input state aw ait ing the arrival of the code byte from the program mem o ry. dur ing the time that the low byte of the program counter is valid on p0, the signal ale (address latch enable) clocks this byte into an ex ter nal address latch. meanwhile, port 2 (p2) emits the high byte of the program counter (pch), and psen strobes the eprom and the code byte is read into the ADUC836. latch eprom oe a8?15 a0?7 d0?7 (instruction) ADUC836 psen p2 ale p0 figure 58. external program memory interface note that program memory addresses are always 16 bits wide, even in cases where the actual amount of program mem o ry used is less than 64 kbytes. external program ex e cu tion sac ri c es two of the 8-bit ports (p0 and p2) to the func tion of ad dress ing the program memory. while executing from ex ter nal program mem o ry , po r ts 0 and 2 can be used si mul ta neous ly for read/write access to external data memory, but not for gen er al-pur pose i/o. though both external program memory and external data mem o ry are accessed using some of the same pins, the two are completely independent of each other from a software point of view. for example, the chip can read/write external data mem o ry while executing from external program memory. figure 59 shows a hardware con guration for accessing up to 64 kbytes of external data memory. this interface is standard to any 8051 compatible mcu. latch sram oe a8?15 a0?7 d0?7 (data) ADUC836 rd p2 ale p0 we wr figure 59. external data memory interface (64 kbytes address space) if access to more than 64 kbytes of ram is desired, a feature unique to the microconverter allows addressing up to 16 mbytes of external ram simply by adding an additional latch, as il lus - trat ed in figure 60. latch ADUC836 rd p2 ale p0 wr latch sram oe a8?15 a0?7 d0?7 (data) we a16?23 figure 60. external data memory interface (16 mbytes address space) in either implementation, port 0 (p0) serves as a multiplexed address/data bus. it emits the low byte of the data pointer (dpl) as an address, which is latched by ale prior to data being placed on the bus by the ADUC836 (write operation) or by the external da ta memory (read operation). port 2 (p2) pro vides the data pointer page byte (dpp) to be latched by ale, fol lowed by the data pointer high byte (dph). if no latch is con nect ed to p2, dpp is ignored by the sram, and the 8051 standard of 64 kbyte external da ta memory access is main tained. detailed timing diagrams of external program and data memory read and write access can be found in the timing speci cations section. rev. 0
ADUC836 ?64? po w er supplies the ADUC836s operational power supply voltage range is 2.7 v to 5.25 v. although the guaranteed data sheet spec i ca tions are gi v en only for power supplies within 2.7 v to 3.6 v or +5% of the nominal 5 v level, the chip will function equally well at any power supply level between 2.7 v and 5.25 v. separate analog and digital power supply pins (av dd and dv dd , respectively) allow av dd to be kept relatively free of noisy dig i tal signals that are often present on the system dv dd line. in this mode, the part can also operate with split supplies, that is, using dif fer ent v oltage supply levels for each supply. for example, this means that the system can be designed to operate with a dv dd voltage level of 3 v while the av dd level can be at 5 v, or vice-versa if required. a typical split-supply con g u ra tion is shown in figure 61. dv dd 48 34 20 ADUC836 5 6 agnd av dd + 0.1 f 10 f analog supply 10 f dgnd 35 21 47 0.1 f digital supply + figure 61. external dual-supply connections as an alternative to providing two separate power supplies, av dd can be kept quiet by placing a small series resistor and/or ferrite bead between it and dv dd , and then decoupling av dd separately to ground. an example of this con guration is shown in figure 62. in this con guration, other analog circuitry (such as op amps, v oltage reference, and so on) can be powered from the av dd sup ply line as well. dv dd 48 34 20 ADUC836 5 6 agnd av dd 0.1 f 10 f dgnd 35 21 47 0.1 f + digital supply 10 f 1.6 bead figure 62. external single-supply connections notice that in figures 61 and 62, a large value (10 f) reservoir capacitor sits on dv dd and a separate 10 f ca pac i tor sits on av dd . also, local decoupling capacitors (0.1 f) are located at each v dd pin of the chip. as per stan dard design prac tice, be sure to include all of these capacitors and ensure the smaller capacitors are closest to each v dd pin with lead lengths as short as possible. connect the ground ter mi nal of each of these capacitors directly to the underlying ground plane. fi nal ly, it should also be noticed that, at all times, the analog and digital ground pins on the ADUC836 should be referenced to the same system ground reference point. po we r-on reset (por) operation an internal por (power-on reset) is implemented on the ADUC836. for dv dd below 2.45 v, the internal por will hold the ADUC836 in reset. as dv dd rises above 2.45 v, an internal timer will time out for typically 128 ms before the part is released from reset. the user must ensure that the power supply has reached a stable 2.7 v minimum level by this time. likewise on power-down, the internal por will hold the ADUC836 in reset until the power supply has dropped below 1 v. figure 63 il lus trates the operation of the internal por in detail. 128ms typ 1.0v typ 128ms typ 2.45v typ 1.0v typ internal core reset dv dd figure 63. internal power-on-reset operation po we r consumption the dv dd power supply current consumption is speci ed in normal, idle, and power-down modes. the av dd power supply current is speci ed with the analog peripherals disabled. the normal mode power consumption represents the current drawn from dv dd by the digital core. the other on-chip peripherals (watchdog timer, power supply monitor, and so on) consume neg li gi ble current and are therefore lumped in with the nor mal op er at ing current here. of course, the user must add any cur rents sourced by the parallel and serial i/o pins, and those sourced by the dac in order to determine the total cur rent needed at the ADUC836s dv dd and av dd supply pins. also, current drawn from the dv dd supply will increase by ap prox i mate ly 5 ma during flash/ee erase and program cycles. rev. 0
ADUC836 ?65? po w er saving modes setting the idle and power-down mode bits, pcon.0 and pcon.1, respectively, in the pcon sfr described in table ii allows the chip to be switched from normal mode into idle mode, and also into full power-down mode. in idle mode, the oscillator continues to run, but the core clock generated from the pll is halted. the on-chip peripherals continue to receive the clock and remain functional. the cpu status is preserved with the stack pointer, program counter, and all other internal registers maintain their data during idle mode. po rt pins and dac output pins also retain their states, and ale and psen outputs go high in this mode. the chip will recover from idle mode upon receiving any enabled interrupt, or upon receiving a hardware reset. in power-down mode, both the pll and the clock to the core are stopped. the on-chip oscillator can be halted or can con tin ue to oscillate, depending on the state of the oscillator pow er-down bit (osc_pd) in the pllcon sfr. the tic, being driven directly from the oscillator, can also be enabled during power-down. all other on-chip peripherals, however, are shut down. port pins retain their logic levels in this mode, but the dac output goes to a high impedance state (three-state) while ale and psen outputs are held low. during full power-down mode with the oscillator and w ake-up timer running, the ADUC836 typically consumes a total of 15 a. there are ve ways of terminating power-down mode: asserting the reset pin (pin 15) returns to normal mode. all registers are set to their reset default v alue and program execution starts at the reset vector once the reset pin is deasserted. cycling power all registers are set to their default state and program execution starts at the reset vector approximately 128 ms later. t ime interval counter (tic) interrupt if the osc_pd bit in the pllcon sfr is clear, the 32 khz oscillator will remain powered up even in power-down mode. if the time interval counter (wakeup/rtc timer) is enabled, a tic interrupt will wake the ADUC836 up from po w er-down mode. the cpu services the tic interrupt. the reti at the end of the tic isr will return the core to the instruction after the one that enabled power-down. spi interrupt if the seripd bit in the pcon sfr is set, then an spi in ter r upt, if enabled, will wake up the ADUC836 from power-down mode. the cpu services the spi interrupt. the reti at the end of the isr will return the core to the instruction after the one that enabled power-down. int0 interrupt if the int0pd bit in the pcon sfr is set, an external interrupt 0, if enabled, will wake up the ADUC836 from power-down. the cpu services the spi interrupt. the reti at the end of the isr will return the core to the in struc tion after the one that enabled power-down. wa ke-up from power-down latency even with the 32 khz crystal enabled during power-down, the pll will take some time to lock after a wake-up from power-down. typ- ically, the pll will take about 1 ms to lock. during this time, code will execute, but not at the speci ed frequency. some operations require an accurate clock, for example, uart communications, to achieve speci ed 50 hz/60 hz rejection from the adcs. the following code may be used to wait for the pll to lock: waitforlock: mov a, pllcon jnb acc.6, waitforlock if the crystal has been powered down during power-down, there is an additional delay associated with the startup of the crystal oscillator before the pll can lock. 32 khz crystals are in her ent ly slow to oscillate, typically taking about 150 ms. once again, during this time before lock, code will execute, but the exact frequency of the clock cannot be guaranteed. again for any timing sensitive operations, it is recommended to wait for lock using the lock bit in pllcon, as shown in the code above. grounding and board layout recommendations as with all high resolution data converters, special attention must be paid to grounding and pc board layout of ADUC836 based designs in order to achieve optimum performance from the adcs and dac. although the ADUC836 has separate pins for analog and digital gr ound (agnd and dgnd), the user must not tie these to two separate ground planes unless the two ground planes are con- nect ed together very close to the ADUC836, as illustrated in the simpli ed example of figure 64a. in systems where digital and analog ground planes are connected together somewhere else (at the systems power supply, for example), they cannot be con- nect ed again near the ADUC836 since a ground loop would result. in these cases, tie the ADUC836s agnd and dgnd pins all to the analog ground plane, as illustrated in figure 64b. in systems with only one ground plane, ensure that the digital and analog com- ponents are physically separated onto separate halves of the board such that digital return currents do not ow near analog circuitry and vice versa. the ADUC836 can then be placed between the digital and analog sections, as illustrated in figure 64c. in all of these scenarios, and in more complicated real-life ap pli - ca tions, keep in mind the ow of current from the supplies and back to ground. make sure the return paths for all currents are as close as possible to the paths the currents took to reach their des- tinations. for example, do not power components on the analog side of figure 64b with dv dd since that would force return cur- rents from dv dd to ow through agnd. also, try to avoid digital currents o wing under analog circuitry, which could happen if the user placed a noisy digital chip on the left half of the board in figure 64c. whenever possible, avoid large discontinuities in the ground plane(s) (such as those formed by a long trace on the same layer), since they force return signals to travel a longer path. and of course, make all connections directly to the ground plane with little or no trace separating the pin from its via to ground. rev. 0
ADUC836 ?66? dgnd agnd pl ace analog comp onents here pl ace digital comp onents here gnd pl ace analog comp onents here pl ace digital comp onents here dgnd a. agnd pl ace analog comp onents here pl ace digital comp onents here b. c. figure 64. system grounding schemes if the user plans to connect fast logic signals (rise/fall time < 5 ns) to any of the ADUC836s digital inputs, add a series re sis tor to each relevant line to keep rise and fall times longer than 5 ns at the ADUC836 input pins. a value of 100  or 200  is usu al ly suf- cient to prevent high speed signals from cou pling ca pac i tive ly into the ADUC836 and affecting the accuracy of adc conversions. ADUC836 system self-identi cation in some hardware designs, it may be an advantage for the soft w are r unning on the ADUC836 target to identify the host microcon- ve r ter. for example, code running on the ADUC836 may also be used with the aduc824 or the aduc816, and is re quired to operate differently. the chipid sfr is a read-only register located at sfr address c2h. the upper nibble of this sfr designates the microconverter within the  -  adc family. user software can read this sfr to identify the host microconverter and thus execute slightly differ- ent code if required. the chipid sfr reads as follows for the  -  adc family of microconverter prod ucts. ADUC836 chipid = 3xh aduc834 chipid = 2xh aduc824 chipid = 0xh aduc816 chipid = 1xh clock oscillator as described earlier, the core clock frequency for the ADUC836 is generated from an on-chip pll that locks onto a multiple (384 times) of 32.768 khz. the latter is generated from an internal clock oscillator. to use the internal clock oscillator, connect a 32.768 khz parallel resonant crystal between the xtal1 and xtal2 pins (32 and 33), as shown in figure 65. as shown in the typical external crystal connection diagram in figure 65, two internal 12 pf capacitors are provided on-chip. these are connected internally, directly to the xtal1 and xtal2 pins, and the total input capacitances at both pins is detailed in the speci cations table. the value of the total load capacitance required for the external crystal should be the value rec om mend ed by the crystal manufacturer for use with that speci c crystal. in many cases, because of the on-chip capacitors, additional external load capacitors will not be required. xtal2 xtal1 32.768khz to internal pll ADUC836 12pf 12pf 32 33 figure 65. external parallel resonant crystal con nec tions other hardware considerations to facilitate in-circuit programming plus in-circuit debug and emulation options, users will want to implement some simple connection points in their hardware that will allow easy access to download, debug, and emulation modes. rev. 0
ADUC836 ?67? o ther hardware considerations in-circuit serial download access nearly all ADUC836 designs will want to take advantage of the in-circuit reprogrammability of the chip. this is accomplished by a connection to the ADUC836s uart, which requires an external rs-232 chip for level translation if downloading code f rom a pc. basic con guration of an rs-232 connection is illus- trated in figure 66 with a simple adm3202 based circuit. if users w ould rather not include an rs-232 chip onto the target board, refer to the application note, uc006?a 4-wire uart-to-pc interface av ailable at www.analog.com/microconverter, for a simple (and zero-cost-per-board) method of gaining in-circuit serial download access to the ADUC836. in addition to the basic uart connections, users will also need a way to trigger the chip into download mode. this is ac com - plished via a 1 k pull-down resistor that can be jumpered onto the psen pin, as shown in figure 66. to get the ADUC836 into download mode, simply connect this jumper and power-cycle the device (or manually reset the device, if a manual reset but ton is av ailable), and it will be ready to receive a new pro g ram serially. with the jumper removed, the device will pow er on in normal mode (and run the program) whenever power is cycled or reset is toggled. note that psen is normally an output (as described in the exter- nal memory interface section) and that it is sampled as an input only on the falling edge of reset (i.e., at power-up or upon an external manual reset). note also that if any external circuitry unintentionally pulls psen low during power-up or reset events, it could cause the chip to enter download mode and therefore fail to begin user code execution as it should. to prevent this, ensure that no external signals are capable of pull ing the psen pin low, except for the external psen jumper itself. embedded serial port debugger from a hardware perspective, entry to serial port debug mode is identical to the serial download entry sequence described above. in fact, both serial download and serial port debug modes can be thought of as essentially one mode of operation used in two different ways. note that the serial port debugger is fully contained on the ADUC836 device, (unlike rom monitor type debuggers) and therefore no external memory is needed to enable in-system debug sessions. single-pin emulation mode also built into the ADUC836 is a dedicated controller for sin gle-pin in-circuit emulation (ice) using standard production ADUC836 devices. in this mode, emulation access is gained by connection to a single pin, the ea pin. normally, this pin is hard-wired either high or low to select execution from internal or external program memory space, as described earlier. to enable single-pin emu- lation mode, however, users will need to pull the ea pin high through a 1 k resistor, as shown in figure 66. the emulator will then connect to the 2-pin header also shown in figure 66. to be compatible with the standard con nec tor that comes with the single-pin emulator available from accutron limited (www.accutron.com), use a 2-pin 0.1-inch pitch friction lock header from molex (www.molex.com) such as their part number 22-27-2021. be sure to observe the polarity of this header. as represented in figure 66, when the friction lock tab is at the r ight, the ground pin should be the lower of the two pins (when viewed from the top). rev. 0
ADUC836 ?68? t ypical system con guration a typical ADUC836 con guration is shown in figure 66. it sum- ma r iz es some of the hardware considerations discussed in the previous paragraphs. figure 66 also includes connections for a typical analog mea- sure ment application of the ADUC836, namely an interface to an r td (resistive temperature device). the arrangement shown is commonly referred to as a 4-wire rtd con guration. here, the on-chip excitation current sources are enabled to excite the sensor. the excitation current o ws directly through the rtd, generating a voltage across the rtd proportional to its resistance. this differential voltage is routed directly to the positive and negative inputs of the primary adc (ain1, ain2, respectively). the same current that excited the rtd also o ws through a series resistance r ref , generating a ratiometric voltage reference v ref . the ratiometric voltage reference en sures that va ri a tions in the excitation current do not affect the mea sure ment system as the input voltage from the rtd and reference voltage across r ref vary ratiometrically with the ex ci ta tion current. resis- tor r ref must, however, have a low tem per a ture coef cient to av oid errors in the reference voltage over temperature. r ref must also be large enough to generate at least a 1 v voltage reference. c1+ v+ c1 c2+ c2 v t2out r2in v cc gnd t1out r1in r1out t1in t2in r2out adm3202 dv dd 27 34 33 31 30 29 28 39 38 37 36 35 32 40 47 46 44 43 42 41 52 51 50 49 48 45 dv dd 1k dv dd 1k 2-pin header for emulation access (normally open) download/debug enable jumper (normally open) 32.768khz dv dd 1 2 3 4 5 6 7 8 9 av dd 200 a/400 a excitation current rtd r ref 5.6k av dd agnd p1.2/i exc 1/dac refin refin+ p1.4/ain1 p1.5/ain2 dv dd dgnd psen ea dgnd dv dd xtal2 xtal1 reset rxd txd dv dd dgnd not connected in this example ADUC836 p1.3/ain5/dac dv dd rs232 interface * standard d-type serial comms connector to pc host * external uart transceiver integrated in system or as part of an external dongle as described in uc006. all capacitors in this example are 0.1 f ceramic capacitors. figure 66. typical system con guration rev. 0
ADUC836 ?69? q uickstart development system the quickstart development system is a full featured, low cost development tool suite supporting the ADUC836. the sys tem consists of the following pc based (windows compatible) hard- w are and software de v el op ment tools: hardware: ADUC836 evaluation board and serial port cable code development: 8051 assembler code functionality: adsim, windows microconverter code simulator in-circuit code download: serial d ownloader in-circuit debugger/emulator: serial port/single pin debugger/emulator with assembly and c source debug miscellaneous other: cd-rom doc u menta tion and two additional pro to type de vic es figure 67 shows the typical com po nents of a quickstart de v el- op ment system while figure 68 shows a typical debug ses sion. a brief de scrip tion of some of the soft w are tools com po nents in the quickstart development system follows. figure 67. components of the quickstart development s ystem download?n circuit downloader the serial downloader is a software program that allows the user to serially download an assembled program (intel hex for mat le) to the on-chip program flash memory via the serial com1 port on a standard pc. application note uc004 details this serial download protocol and is available from www.analog.com/microconverter. debugger/emulator?n-circuit debugger/emulator the debugger/emulator is a windows application that allo ws the user to debug code execution on silicon using the microconver ter ua rt serial port or via a single pin to provide nonintrusive debug. the debugger pro vides ac cess to all on-chip peripherals dur ing a typ i cal debug session, including sin gle-step and multiple break-point code ex e cu tion control. c source and assembly level debug are both possible with the emulator. adsim?indows sim u la tor the simulator is a windows application that fully simulates the microconverter functionality including adc and dac pe r iph - er als. the simulator provides an easy-to-use, in tu i tive, in ter f ace to the microconverter func tion al ity and in te gr a tes many stan dard debug features including mul ti ple breakpoints, single stepping, and code execution trace ca pa bil i ty. this tool can be used both as a tutorial guide to the part as well as an ef cient way to prove code func tion al ity be fore moving to a hardware platform. figure 68. typical debug session rev. 0
ADUC836 ?70? timing specifications 1, 2, 3 (av dd = 2.7 v to 3.6 v or 4.75 v to 5.25 v, dv dd = 2.7 v to 3.6 v or 4.75 v to 5.25 v; all speci? cations t min to t max , unless otherwise noted.) 32.768 khz exter nal crystal p arameter min typ max unit clock input (external clock driven xtal1) t ck xtal1 period 30.52 s t ckl xtal1 width low 6.26 s t ckh xtal1 width high 6.26 s t ckr xtal1 rise time 9 s t ckf xtal1 fall time 9 s 1/t core ADUC836 core clock frequency 4 0.098 12.58 mhz t core ADUC836 core clock period 5 0.636 s t cyc ADUC836 machine cycle time 6 0.95 7.6 122.45 s notes 1 ac inputs during testing are driven at dv dd ?0.5 v for a logic 1, and 0.45 v for a logic 0. timing measurements are made at v ih min for a logic 1, and v il max for a logic 0, as shown in figure 70. 2 fo r timing purposes, a port pin is no longer oating when a 100 mv change from load voltage occurs. a port pin begins to oat when a 100 mv change from the loaded v oh /v ol level occurs, as shown in figure 70. 3 c load for port 0, ale, psen outputs = 100 pf; c load for all other outputs = 80 pf, unless otherwise noted. 4 ADUC836 internal pll locks onto a multiple (384 times) the external crystal frequency of 32.768 khz to provide a stable 12.583 mhz internal clock for the system. the core can operate at this frequency or at a binary submultiple called core_clk, selected via the pllcon sfr. 5 this number is measured at the default core_clk operating frequency of 1.57 mhz. 6 ADUC836 machine cycle time is nominally de ned as 12/core_clk. t ckh t ckl t ck t ckf t ckr figure 69. xtal1 input dv dd ?0.5v 0.45v 0.2dv dd + 0.9v test points 0.2dv dd 0.1v v load ?0.1v v load v load + 0.1v timing reference points v load ?0.1v v load v load + 0.1v figure 70. timing waveform characteristics rev. 0
ADUC836 ?71? 12.58 mhz core_clk vari able core_clk p arameter min max min max unit external program memory t lhll ale pulsewidth 119 2t core ?40 ns t av l l address valid to ale low 39 t core ?40 ns t llax address hold after ale low 49 t core ?30 ns t lliv ale low to valid instruction in 218 4t core ?100 ns t llpl ale low to psen low 49 t core ?30 ns t plph psen pulsewidth 193 3t core ?45 ns t pliv psen low to valid instruction in 133 3t core ?105 ns t pxix input instruction hold after psen 0 0 ns t pxiz input instruction float after psen 54 t core ?25 ns t av i v address to valid instruction in 292 5t core ?105 ns t plaz psen low to address float 25 25 ns t phax address hold after psen high 0 0 ns t lhll t avll pcl (out) instruction (in) pch core_clk ale (o) psen (o) port 0 (i/o) port 2 (o) t llpl t llax t plaz t pxix t pxiz t pliv t lliv t plph t phax t aviv figure 71. external program memory read cycle rev. 0
ADUC836 ?72? 12.58 mhz core_clk va r iable core_clk p arameter min max min max unit external data memory read cycle t rlrh rd pulsewidth 377 6t core ?100 ns t av l l address valid after ale low 39 t core ?40 ns t llax address hold after ale low 44 t core ?35 ns t rldv rd low to valid data in 232 5t core ?165 ns t rhdx data and address hold after rd 0 0 ns t rhdz data float after rd 89 2t core ?70 ns t lldv ale low to valid data in 486 8t core ?150 ns t av dv address to valid data in 550 9t core ?165 ns t llwl ale low to rd low 188 288 3t core ?50 3t core + 50 ns t av w l address valid to rd low 188 4t core ?130 ns t rlaz rd low to address float 0 0 ns t whlh rd high to ale high 39 119 t core ?40 t core + 40 ns t llax data (in) core_clk ale (o) psen (o) port 0 (i/o) port 2 (o) rd (o ) t lldv t llwl t avwl t avll t avdv t rlaz t rldv t rhdx t rhdz t whlh a0?7 (out) a16?23 a8?15 t rlrh figure 72. external data memory read cycle rev. 0
ADUC836 ?73? 12.58 mhz core_clk va r iable core_clk p arameter min max min max unit external data memory write cycle t wlwh wr pulsewidth 377 6t core ?100 ns t av l l address valid after ale low 39 t core ?40 ns t llax address hold after ale low 44 t core ?35 ns t llwl ale low to wr low 188 288 3t core ?50 3t core + 50 ns t av w l address valid to wr low 188 4t core ?130 ns t qvwx data valid to wr t ransition 29 t core ?50 ns t qvwh data setup before wr 406 7t core ?150 ns t whqx data and address hold after wr 29 t core ?50 ns t whlh wr high to ale high 39 119 t core ?40 t core + 40 ns t llax a0?7 core_clk ale (o) psen (o) port 0 (o) port 2 (o) wr (o ) t whlh t whqx t wlwh t qvwx t qvwh t llwl t avwl t avll a16?23 a8?15 data figure 73. external data memory write cycle rev. 0
ADUC836 ?74? 12.58 mhz core_clk varia bl e core_clk p arameter min typ max min typ max unit ua rt timing (shift register mode) t xlxl serial port clock cycle time 0.95 12t core s t qvxh output data setup to clock 662 10t core ?133 ns t dvxh input data setup to clock 292 2t core + 133 ns t xhdx input data hold after clock 0 0 ns t xhqx output data hold after clock 42 2t core ?117 ns set ri or set ti 01 bit 1 t xlxl ale (o) txd (output clock) rxd (output data) rxd (input data) 67 bit 6 msb msb bit 6 bit 1 lsb t xhqx t qvxh t dvxh t xhdx figure 74. uart timing in shift register mode rev. 0
ADUC836 ?75? p arameter min typ max unit spi master mode timing (cpha = 1) t sl sclock low pulsewidth * 630 ns t sh sclock high pulsewidth * 630 ns t dav data output valid after sclock edge 50 ns t dsu data input setup time before sclock edge 100 ns t dhd data input hold time after sclock edge 100 ns t df data output fall time 10 25 ns t dr data output rise time 10 25 ns t sr sclock rise time 10 25 ns t sf sclock fall time 10 25 ns * characterized under the following conditions: core clock divider bits cd2, cd1, and cd0 in pllcon sfr set to 0, 1, and 1, respectively, i.e., core clock frequency = 1.57 mhz , and spi bit rate selection bits spr1 and spr0 in spicon sfr are both set to 0. sclock (cp ol = 0) t dsu sclock (cp ol = 1) mosi miso msb lsb lsb in bits 6? bits 6? t dhd t dr t dav t df t dosu t sh t sl t sr t sf msb in figure 75. spi master mode timing (cpha = 1) rev. 0
ADUC836 ?76? p arameter min typ max u nit spi master mode timing (cpha = 0) t sl sclock low pulsewidth * 630 ns t sh sclock high pulsewidth * 630 ns t dav data output valid after sclock edge 50 ns t dosu data output setup before sclock edge 150 ns t dsu data input setup time before sclock edge 100 ns t dhd data input hold time after sclock edge 100 ns t df data output fall time 10 25 ns t dr data output rise time 10 25 ns t sr sclock rise time 10 25 ns t sf sclock fall time 10 25 ns * characterized under the following conditions: 1. core clock divider bits cd2, cd1, and cd0 in pllcon sfr set to 0, 1, and 1 respectively, i.e., core clock frequency = 1.57 m hz. 2. spi bit rate selection bits spr1 and spr0 in spicon sfr are both set to 0. sclock (cp ol = 0) sclock (cp ol = 1) mosi miso msb in bits 6? bits 6? lsb in lsb msb t dav t df t dr t sr t sf t dhd t dsu t sh t sl figure 76. spi master mode timing (cpha = 0) rev. 0
ADUC836 ?77? p arameter min typ max unit spi slave mode timing (cpha = 1) t ss ss to sclock edge 0 ns t sl sclock low pulsewidth 330 ns t sh sclock high pulsewidth 330 ns t dav data output valid after sclock edge 50 ns t dsu data input setup time before sclock edge 100 ns t dhd data input hold time after sclock edge 100 ns t df data output fall time 10 25 ns t dr data output rise time 10 25 ns t sr sclock rise time 10 25 ns t sf sclock fall time 10 25 ns t sfs ss high after sclock edge 0 ns sclock (cpo l = 0) sclock (cpo l = 1) miso mosi ss msb in bits 6 1 lsb in lsb bits 6 1 msb t dhd t dsu t df t dr t sl t sh t dav t sr t sf t sfs t ss figure 77. spi slave mode timing (cpha = 1) rev. 0
ADUC836 ?78? p arameter min typ max unit spi slave mode timing (cpha = 0) t ss ss to sclock edge 0 ns t sl sclock low pulsewidth 330 ns t sh sclock high pulsewidth 330 ns t dav data output valid after sclock edge 50 ns t dsu data input setup time before sclock edge 100 ns t dhd data input hold time after sclock edge 100 ns t df data output fall time 10 25 ns t dr data output rise time 10 25 ns t sr sclock rise time 10 25 ns t sf sclock fall time 10 25 ns t ssr ss to sclock edge 50 ns t doss data output valid after ss edge 20 ns t sfs ss high after sclock edge 0 ns miso mosi sclock (cp ol = 1) sclock (cp ol = 0) ss msb bits 6? lsb bits 6? lsb in t dhd t dsu t dr t df t dav t doss t sh t sl t sr t sf t sfs msb in t ss figure 78. spi slave mode timing (cpha = 0) rev. 0
ADUC836 ?79? p arameter min max unit i 2 c-serial interface timing t l sclock low pulsewidth 4.7 ? t h sclock high pulsewidth 4.0 ? t shd start condition hold time 0.6 ? t dsu data setup time 100 ns t dhd data hold time 0.9 s t rsu setup time for repeated start 0.6 ? t psu stop condition setup time 0.6 ? t buf bus free time between a stop 1.3 ? condition and a start condition t r rise time of both sclock and sdata 300 ns t f fall time of both sclock and sdata 300 ns t sup * pulsewidth of spike suppressed 50 ns * input ltering on both the sclock and sdata inputs surpresses noise spikes less than 50 ns. msb t buf sdata (i/o) sclk (i) stop condition start condition repeated start lsb ack msb 12-78 9 1 s(r) ps t psu t dsu t shd t dhd t sup t dsu t dhd t h t sup t l t rsu t r t r t f t f figure 79. i 2 c compatible interface timing rev. 0
c02991?0?11/02(0) printed in u.s.a. ?80? ADUC836 outline dimensions 52-lead plastic quad flatpack [mqfp] (s-52) dimensions shown in millimeters seating plane view a 0.23 0.11 2.45 max 1.03 0.88 0.73 top view (pins down) 1 39 40 13 14 27 26 52 pin 1 0.65 bsc 13.45 13.20 sq 12.95 7.80 ref 10.20 10.00 sq 9.80 0.40 0.22 view a rotated 90 ccw 7 0 2.20 2.00 1.80 0.10 min coplanarity compliant to jedec standards mo-022-ac 56-lead frame chip scale package [lfcsp] 8 8 mm body (cp-56) dimensions shown in millimeters pin 1 indicator top view 7.75 bsc sq 8.00 bsc sq 1 56 14 15 43 42 28 29 bottom view 6.25 6.10 5.95 0.50 0.40 0.30 0.30 0.23 0.18 0.50 bsc 12 max 0.20 ref 1.00 max 0.65 nom 1.00 0.90 0.80 6.50 ref seating plane 0.10 max 0.60 max 0.60 max pin 1 indicator compliant to jedec standards mo-220-vlld-2 coplanarity 0.08 sq rev. 0


▲Up To Search▲   

 
Price & Availability of ADUC836

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X